From 0f4a5a81841df6c03352a4c9778b36d808d779c0 Mon Sep 17 00:00:00 2001 From: AudricV <74829229+AudricV@users.noreply.github.com> Date: Wed, 20 Jul 2022 23:36:27 +0200 Subject: [PATCH] Replace avatar and thumbnail URLs attributes and methods to List in InfoItemsCollectors --- .../channel/ChannelInfoItemsCollector.java | 20 ++++---- .../comments/CommentsInfoItemsCollector.java | 4 +- .../playlist/PlaylistInfoItemsCollector.java | 2 +- .../stream/StreamInfoItemsCollector.java | 47 +++++++++---------- 4 files changed, 36 insertions(+), 37 deletions(-) diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/channel/ChannelInfoItemsCollector.java b/extractor/src/main/java/org/schabi/newpipe/extractor/channel/ChannelInfoItemsCollector.java index 5b085f8b8..5b8ff6918 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/channel/ChannelInfoItemsCollector.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/channel/ChannelInfoItemsCollector.java @@ -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 - * 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 . + * along with NewPipe Extractor. If not, see . */ +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 { 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); } diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/comments/CommentsInfoItemsCollector.java b/extractor/src/main/java/org/schabi/newpipe/extractor/comments/CommentsInfoItemsCollector.java index 3afeb0455..fca5bdf59 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/comments/CommentsInfoItemsCollector.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/comments/CommentsInfoItemsCollector.java @@ -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); } diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/playlist/PlaylistInfoItemsCollector.java b/extractor/src/main/java/org/schabi/newpipe/extractor/playlist/PlaylistInfoItemsCollector.java index 4fe35e40e..0b854a999 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/playlist/PlaylistInfoItemsCollector.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/playlist/PlaylistInfoItemsCollector.java @@ -32,7 +32,7 @@ public class PlaylistInfoItemsCollector addError(e); } try { - resultItem.setThumbnailUrl(extractor.getThumbnailUrl()); + resultItem.setThumbnails(extractor.getThumbnails()); } catch (final Exception e) { addError(e); } diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamInfoItemsCollector.java b/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamInfoItemsCollector.java index 35cf7fd32..c0e1ac1e6 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamInfoItemsCollector.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamInfoItemsCollector.java @@ -1,3 +1,23 @@ +/* + * Created by Christian Schabesberger on 28.02.16. + * + * Copyright (C) Christian Schabesberger 2016 + * 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 . + */ + 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 - * 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 . - */ - public class StreamInfoItemsCollector extends InfoItemsCollector { @@ -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); }