Skip to content

Commit 0f4a5a8

Browse files
committed
Replace avatar and thumbnail URLs attributes and methods to List<Image> in InfoItemsCollectors
1 parent ca1d4a6 commit 0f4a5a8

4 files changed

Lines changed: 28 additions & 29 deletions

File tree

extractor/src/main/java/org/schabi/newpipe/extractor/channel/ChannelInfoItemsCollector.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
package org.schabi.newpipe.extractor.channel;
2-
3-
import org.schabi.newpipe.extractor.InfoItemsCollector;
4-
import org.schabi.newpipe.extractor.exceptions.ParsingException;
5-
61
/*
72
* Created by Christian Schabesberger on 12.02.17.
83
*
94
* Copyright (C) Christian Schabesberger 2017 <chris.schabesberger@mailbox.org>
10-
* ChannelInfoItemsCollector.java is part of NewPipe.
5+
* ChannelInfoItemsCollector.java is part of NewPipe Extractor.
116
*
12-
* NewPipe is free software: you can redistribute it and/or modify
7+
* NewPipe Extractor is free software: you can redistribute it and/or modify
138
* it under the terms of the GNU General Public License as published by
149
* the Free Software Foundation, either version 3 of the License, or
1510
* (at your option) any later version.
1611
*
17-
* NewPipe is distributed in the hope that it will be useful,
12+
* NewPipe Extractor is distributed in the hope that it will be useful,
1813
* but WITHOUT ANY WARRANTY; without even the implied warranty of
1914
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2015
* GNU General Public License for more details.
2116
*
2217
* You should have received a copy of the GNU General Public License
23-
* along with NewPipe. If not, see <http://www.gnu.org/licenses/>.
18+
* along with NewPipe Extractor. If not, see <https://www.gnu.org/licenses/>.
2419
*/
2520

21+
package org.schabi.newpipe.extractor.channel;
22+
23+
import org.schabi.newpipe.extractor.InfoItemsCollector;
24+
import org.schabi.newpipe.extractor.exceptions.ParsingException;
25+
2626
public final class ChannelInfoItemsCollector
2727
extends InfoItemsCollector<ChannelInfoItem, ChannelInfoItemExtractor> {
2828
public ChannelInfoItemsCollector(final int serviceId) {
@@ -47,7 +47,7 @@ public ChannelInfoItem extract(final ChannelInfoItemExtractor extractor)
4747
addError(e);
4848
}
4949
try {
50-
resultItem.setThumbnailUrl(extractor.getThumbnailUrl());
50+
resultItem.setThumbnails(extractor.getThumbnails());
5151
} catch (final Exception e) {
5252
addError(e);
5353
}

extractor/src/main/java/org/schabi/newpipe/extractor/comments/CommentsInfoItemsCollector.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public CommentsInfoItem extract(final CommentsInfoItemExtractor extractor)
3636
addError(e);
3737
}
3838
try {
39-
resultItem.setUploaderAvatarUrl(extractor.getUploaderAvatarUrl());
39+
resultItem.setUploaderAvatars(extractor.getUploaderAvatars());
4040
} catch (final Exception e) {
4141
addError(e);
4242
}
@@ -66,7 +66,7 @@ public CommentsInfoItem extract(final CommentsInfoItemExtractor extractor)
6666
addError(e);
6767
}
6868
try {
69-
resultItem.setThumbnailUrl(extractor.getThumbnailUrl());
69+
resultItem.setThumbnails(extractor.getThumbnails());
7070
} catch (final Exception e) {
7171
addError(e);
7272
}

extractor/src/main/java/org/schabi/newpipe/extractor/playlist/PlaylistInfoItemsCollector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public PlaylistInfoItem extract(final PlaylistInfoItemExtractor extractor)
3232
addError(e);
3333
}
3434
try {
35-
resultItem.setThumbnailUrl(extractor.getThumbnailUrl());
35+
resultItem.setThumbnails(extractor.getThumbnails());
3636
} catch (final Exception e) {
3737
addError(e);
3838
}

extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamInfoItemsCollector.java

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
1-
package org.schabi.newpipe.extractor.stream;
2-
3-
import org.schabi.newpipe.extractor.InfoItemsCollector;
4-
import org.schabi.newpipe.extractor.exceptions.FoundAdException;
5-
import org.schabi.newpipe.extractor.exceptions.ParsingException;
6-
7-
import java.util.Comparator;
8-
91
/*
102
* Created by Christian Schabesberger on 28.02.16.
113
*
124
* Copyright (C) Christian Schabesberger 2016 <chris.schabesberger@mailbox.org>
13-
* StreamInfoItemsCollector.java is part of NewPipe.
5+
* StreamInfoItemsCollector.java is part of NewPipe Extractor.
146
*
15-
* NewPipe is free software: you can redistribute it and/or modify
7+
* NewPipe Extractor is free software: you can redistribute it and/or modify
168
* it under the terms of the GNU General Public License as published by
179
* the Free Software Foundation, either version 3 of the License, or
1810
* (at your option) any later version.
1911
*
20-
* NewPipe is distributed in the hope that it will be useful,
12+
* NewPipe Extractor is distributed in the hope that it will be useful,
2113
* but WITHOUT ANY WARRANTY; without even the implied warranty of
2214
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2315
* GNU General Public License for more details.
2416
*
2517
* You should have received a copy of the GNU General Public License
26-
* along with NewPipe. If not, see <http://www.gnu.org/licenses/>.
18+
* along with NewPipe Extractor. If not, see <https://www.gnu.org/licenses/>.
2719
*/
2820

21+
package org.schabi.newpipe.extractor.stream;
22+
23+
import org.schabi.newpipe.extractor.InfoItemsCollector;
24+
import org.schabi.newpipe.extractor.exceptions.FoundAdException;
25+
import org.schabi.newpipe.extractor.exceptions.ParsingException;
26+
27+
import java.util.Comparator;
28+
2929
public class StreamInfoItemsCollector
3030
extends InfoItemsCollector<StreamInfoItem, StreamInfoItemExtractor> {
3131

@@ -74,7 +74,7 @@ public StreamInfoItem extract(final StreamInfoItemExtractor extractor) throws Pa
7474
addError(e);
7575
}
7676
try {
77-
resultItem.setThumbnailUrl(extractor.getThumbnailUrl());
77+
resultItem.setThumbnails(extractor.getThumbnails());
7878
} catch (final Exception e) {
7979
addError(e);
8080
}
@@ -84,7 +84,7 @@ public StreamInfoItem extract(final StreamInfoItemExtractor extractor) throws Pa
8484
addError(e);
8585
}
8686
try {
87-
resultItem.setUploaderAvatarUrl(extractor.getUploaderAvatarUrl());
87+
resultItem.setUploaderAvatars(extractor.getUploaderAvatars());
8888
} catch (final Exception e) {
8989
addError(e);
9090
}
@@ -111,8 +111,7 @@ public StreamInfoItem extract(final StreamInfoItemExtractor extractor) throws Pa
111111
public void commit(final StreamInfoItemExtractor extractor) {
112112
try {
113113
addItem(extract(extractor));
114-
} catch (final FoundAdException ae) {
115-
//System.out.println("AD_WARNING: " + ae.getMessage());
114+
} catch (final FoundAdException ignored) {
116115
} catch (final Exception e) {
117116
addError(e);
118117
}

0 commit comments

Comments
 (0)