2
0
mirror of https://github.com/TeamNewPipe/NewPipeExtractor synced 2025-09-02 15:25:32 +00:00

Code style

This commit is contained in:
Stypox
2025-07-28 20:44:40 +02:00
parent 03a65516b0
commit bd6e5d3fdb

View File

@@ -26,13 +26,11 @@ public class YoutubeMusicAlbumOrPlaylistInfoItemExtractor implements PlaylistInf
final String searchType) { final String searchType) {
this.albumOrPlaylistInfoItem = albumOrPlaylistInfoItem; this.albumOrPlaylistInfoItem = albumOrPlaylistInfoItem;
if (searchType.equals(MUSIC_ALBUMS)) { this.descriptionElementUploader = descriptionElements.getObject(
// "Album", " • ", uploader, " • ", year // For albums: "Album/Single/EP", " • ", uploader, " • ", year -> uploader is at 2
this.descriptionElementUploader = descriptionElements.getObject(2); // For playlists: uploader, " • ", view count -> uploader is at 0
} else { MUSIC_ALBUMS.equals(searchType) ? 2 : 0
// uploader, " • ", view count );
this.descriptionElementUploader = descriptionElements.getObject(0);
}
} }
@Nonnull @Nonnull
@@ -122,14 +120,13 @@ public class YoutubeMusicAlbumOrPlaylistInfoItemExtractor implements PlaylistInf
} }
// then try obtaining it from the uploader description element // then try obtaining it from the uploader description element
if (descriptionElementUploader.has("navigationEndpoint")) { if (!descriptionElementUploader.has("navigationEndpoint")) {
return getUrlFromNavigationEndpoint(
descriptionElementUploader.getObject("navigationEndpoint"));
} else {
// if there is no navigationEndpoint for the uploader // if there is no navigationEndpoint for the uploader
// then this playlist/album is likely autogenerated // then this playlist/album is likely autogenerated
return null; return null;
} }
return getUrlFromNavigationEndpoint(
descriptionElementUploader.getObject("navigationEndpoint"));
} }
@Override @Override