2
0
mirror of https://github.com/TeamNewPipe/NewPipeExtractor synced 2025-08-31 14:26:14 +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) {
this.albumOrPlaylistInfoItem = albumOrPlaylistInfoItem;
if (searchType.equals(MUSIC_ALBUMS)) {
// "Album", " • ", uploader, " • ", year
this.descriptionElementUploader = descriptionElements.getObject(2);
} else {
// uploader, " • ", view count
this.descriptionElementUploader = descriptionElements.getObject(0);
}
this.descriptionElementUploader = descriptionElements.getObject(
// For albums: "Album/Single/EP", " • ", uploader, " • ", year -> uploader is at 2
// For playlists: uploader, " • ", view count -> uploader is at 0
MUSIC_ALBUMS.equals(searchType) ? 2 : 0
);
}
@Nonnull
@@ -122,14 +120,13 @@ public class YoutubeMusicAlbumOrPlaylistInfoItemExtractor implements PlaylistInf
}
// then try obtaining it from the uploader description element
if (descriptionElementUploader.has("navigationEndpoint")) {
return getUrlFromNavigationEndpoint(
descriptionElementUploader.getObject("navigationEndpoint"));
} else {
if (!descriptionElementUploader.has("navigationEndpoint")) {
// if there is no navigationEndpoint for the uploader
// then this playlist/album is likely autogenerated
return null;
}
return getUrlFromNavigationEndpoint(
descriptionElementUploader.getObject("navigationEndpoint"));
}
@Override