Replace avatar and thumbnail URLs attributes and methods to List<Image> in InfoItemsCollectors

This commit is contained in:
AudricV 2022-07-20 23:36:27 +02:00
parent ca1d4a6fa4
commit 0f4a5a8184
No known key found for this signature in database
GPG Key ID: DA92EC7905614198
4 changed files with 36 additions and 37 deletions

View File

@ -1,28 +1,28 @@
package org.schabi.newpipe.extractor.channel;
import org.schabi.newpipe.extractor.InfoItemsCollector;
import org.schabi.newpipe.extractor.exceptions.ParsingException;
/*
* Created by Christian Schabesberger on 12.02.17.
*
* Copyright (C) Christian Schabesberger 2017 <chris.schabesberger@mailbox.org>
* ChannelInfoItemsCollector.java is part of NewPipe.
* ChannelInfoItemsCollector.java is part of NewPipe Extractor.
*
* NewPipe is free software: you can redistribute it and/or modify
* NewPipe Extractor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* NewPipe is distributed in the hope that it will be useful,
* NewPipe Extractor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with NewPipe. If not, see <http://www.gnu.org/licenses/>.
* along with NewPipe Extractor. If not, see <https://www.gnu.org/licenses/>.
*/
package org.schabi.newpipe.extractor.channel;
import org.schabi.newpipe.extractor.InfoItemsCollector;
import org.schabi.newpipe.extractor.exceptions.ParsingException;
public final class ChannelInfoItemsCollector
extends InfoItemsCollector<ChannelInfoItem, ChannelInfoItemExtractor> {
public ChannelInfoItemsCollector(final int serviceId) {
@ -47,7 +47,7 @@ public final class ChannelInfoItemsCollector
addError(e);
}
try {
resultItem.setThumbnailUrl(extractor.getThumbnailUrl());
resultItem.setThumbnails(extractor.getThumbnails());
} catch (final Exception e) {
addError(e);
}

View File

@ -36,7 +36,7 @@ public final class CommentsInfoItemsCollector
addError(e);
}
try {
resultItem.setUploaderAvatarUrl(extractor.getUploaderAvatarUrl());
resultItem.setUploaderAvatars(extractor.getUploaderAvatars());
} catch (final Exception e) {
addError(e);
}
@ -66,7 +66,7 @@ public final class CommentsInfoItemsCollector
addError(e);
}
try {
resultItem.setThumbnailUrl(extractor.getThumbnailUrl());
resultItem.setThumbnails(extractor.getThumbnails());
} catch (final Exception e) {
addError(e);
}

View File

@ -32,7 +32,7 @@ public class PlaylistInfoItemsCollector
addError(e);
}
try {
resultItem.setThumbnailUrl(extractor.getThumbnailUrl());
resultItem.setThumbnails(extractor.getThumbnails());
} catch (final Exception e) {
addError(e);
}

View File

@ -1,3 +1,23 @@
/*
* Created by Christian Schabesberger on 28.02.16.
*
* Copyright (C) Christian Schabesberger 2016 <chris.schabesberger@mailbox.org>
* StreamInfoItemsCollector.java is part of NewPipe Extractor.
*
* NewPipe Extractor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* NewPipe Extractor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with NewPipe Extractor. If not, see <https://www.gnu.org/licenses/>.
*/
package org.schabi.newpipe.extractor.stream;
import org.schabi.newpipe.extractor.InfoItemsCollector;
@ -6,26 +26,6 @@ import org.schabi.newpipe.extractor.exceptions.ParsingException;
import java.util.Comparator;
/*
* Created by Christian Schabesberger on 28.02.16.
*
* Copyright (C) Christian Schabesberger 2016 <chris.schabesberger@mailbox.org>
* StreamInfoItemsCollector.java is part of NewPipe.
*
* NewPipe is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* NewPipe is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with NewPipe. If not, see <http://www.gnu.org/licenses/>.
*/
public class StreamInfoItemsCollector
extends InfoItemsCollector<StreamInfoItem, StreamInfoItemExtractor> {
@ -74,7 +74,7 @@ public class StreamInfoItemsCollector
addError(e);
}
try {
resultItem.setThumbnailUrl(extractor.getThumbnailUrl());
resultItem.setThumbnails(extractor.getThumbnails());
} catch (final Exception e) {
addError(e);
}
@ -84,7 +84,7 @@ public class StreamInfoItemsCollector
addError(e);
}
try {
resultItem.setUploaderAvatarUrl(extractor.getUploaderAvatarUrl());
resultItem.setUploaderAvatars(extractor.getUploaderAvatars());
} catch (final Exception e) {
addError(e);
}
@ -111,8 +111,7 @@ public class StreamInfoItemsCollector
public void commit(final StreamInfoItemExtractor extractor) {
try {
addItem(extract(extractor));
} catch (final FoundAdException ae) {
//System.out.println("AD_WARNING: " + ae.getMessage());
} catch (final FoundAdException ignored) {
} catch (final Exception e) {
addError(e);
}