mirror of
https://github.com/jellyfin/jellyfin-androidtv.git
synced 2026-10-26 16:45:23 +00:00
Cleanup navigation destinations
This commit is contained in:
1 parent
1f8cfa0f30
commit
72ff0cfae8
3 files changed
+15
-20
No files matched your search
@@ -357,13 +357,13 @@ public class EnhancedBrowseFragment extends Fragment implements RowLoader, View.
|
||||
if (item instanceof GridButton) {
|
||||
switch (((GridButton) item).getId()) {
|
||||
case GRID:
|
||||
navigationRepository.getValue().navigate(Destinations.INSTANCE.libraryBrowser(mFolder));
|
||||
navigationRepository.getValue().navigate(Destinations.INSTANCE.libraryBrowser(mFolder, null));
|
||||
break;
|
||||
|
||||
case ALBUMS:
|
||||
mFolder = JavaCompat.copyWithDisplayPreferencesId(mFolder, mFolder.getId() + "AL");
|
||||
|
||||
navigationRepository.getValue().navigate(Destinations.INSTANCE.libraryBrowser(mFolder, BaseItemKind.MUSIC_ALBUM.getSerialName()));
|
||||
navigationRepository.getValue().navigate(Destinations.INSTANCE.libraryBrowser(mFolder, null));
|
||||
break;
|
||||
|
||||
case ALBUM_ARTISTS:
|
||||
|
||||
@@ -56,13 +56,13 @@ public class ItemLauncher {
|
||||
LibraryPreferences displayPreferences = preferencesRepository.getValue().getLibraryPreferences(baseItem.getDisplayPreferencesId());
|
||||
boolean enableSmartScreen = displayPreferences.get(LibraryPreferences.Companion.getEnableSmartScreen());
|
||||
|
||||
if (!enableSmartScreen) return Destinations.INSTANCE.libraryBrowser(baseItem);
|
||||
if (!enableSmartScreen) return Destinations.INSTANCE.libraryBrowser(baseItem, null);
|
||||
else return Destinations.INSTANCE.librarySmartScreen(baseItem);
|
||||
case MUSIC:
|
||||
case LIVETV:
|
||||
return Destinations.INSTANCE.librarySmartScreen(baseItem);
|
||||
default:
|
||||
return Destinations.INSTANCE.libraryBrowser(baseItem);
|
||||
return Destinations.INSTANCE.libraryBrowser(baseItem, null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@ public class ItemLauncher {
|
||||
baseItem = JavaCompat.copyWithDisplayPreferencesId(baseItem, baseItem.getId().toString());
|
||||
}
|
||||
|
||||
navigationRepository.getValue().navigate(Destinations.INSTANCE.libraryBrowser(baseItem));
|
||||
navigationRepository.getValue().navigate(Destinations.INSTANCE.libraryBrowser(baseItem, null));
|
||||
} else {
|
||||
switch (rowItem.getSelectAction()) {
|
||||
|
||||
|
||||
@@ -39,50 +39,45 @@ object Destinations {
|
||||
|
||||
// Browsing
|
||||
// TODO only pass item id instead of complete JSON to browsing destinations
|
||||
fun libraryBrowser(item: BaseItemDto) = fragmentDestination<BrowseGridFragment>(
|
||||
Extras.Folder to Json.Default.encodeToString(item),
|
||||
)
|
||||
|
||||
// TODO only pass item id instead of complete JSON to browsing destinations
|
||||
fun libraryBrowser(item: BaseItemDto, includeType: String) =
|
||||
fun libraryBrowser(item: BaseItemDto, includeType: String? = null) =
|
||||
fragmentDestination<BrowseGridFragment>(
|
||||
Extras.Folder to Json.Default.encodeToString(item),
|
||||
Extras.Folder to Json.encodeToString(item),
|
||||
Extras.IncludeType to includeType,
|
||||
)
|
||||
|
||||
// TODO only pass item id instead of complete JSON to browsing destinations
|
||||
fun librarySmartScreen(item: BaseItemDto) = fragmentDestination<BrowseViewFragment>(
|
||||
Extras.Folder to Json.Default.encodeToString(item),
|
||||
Extras.Folder to Json.encodeToString(item),
|
||||
)
|
||||
|
||||
// TODO only pass item id instead of complete JSON to browsing destinations
|
||||
fun collectionBrowser(item: BaseItemDto) = fragmentDestination<CollectionFragment>(
|
||||
Extras.Folder to Json.Default.encodeToString(item),
|
||||
Extras.Folder to Json.encodeToString(item),
|
||||
)
|
||||
|
||||
// TODO only pass item id instead of complete JSON to browsing destinations
|
||||
fun folderBrowser(item: BaseItemDto) = fragmentDestination<GenericFolderFragment>(
|
||||
Extras.Folder to Json.Default.encodeToString(item),
|
||||
Extras.Folder to Json.encodeToString(item),
|
||||
)
|
||||
|
||||
// TODO only pass item id instead of complete JSON to browsing destinations
|
||||
fun libraryByGenres(item: BaseItemDto, includeType: String) =
|
||||
fragmentDestination<ByGenreFragment>(
|
||||
Extras.Folder to Json.Default.encodeToString(item),
|
||||
Extras.Folder to Json.encodeToString(item),
|
||||
Extras.IncludeType to includeType,
|
||||
)
|
||||
|
||||
// TODO only pass item id instead of complete JSON to browsing destinations
|
||||
fun libraryByLetter(item: BaseItemDto, includeType: String) =
|
||||
fragmentDestination<ByLetterFragment>(
|
||||
Extras.Folder to Json.Default.encodeToString(item),
|
||||
Extras.Folder to Json.encodeToString(item),
|
||||
Extras.IncludeType to includeType,
|
||||
)
|
||||
|
||||
// TODO only pass item id instead of complete JSON to browsing destinations
|
||||
fun librarySuggestions(item: BaseItemDto) =
|
||||
fragmentDestination<SuggestedMoviesFragment>(
|
||||
Extras.Folder to Json.Default.encodeToString(item),
|
||||
Extras.Folder to Json.encodeToString(item),
|
||||
)
|
||||
|
||||
// Item details
|
||||
@@ -95,14 +90,14 @@ object Destinations {
|
||||
fragmentDestination<FullDetailsFragment>(
|
||||
"ItemId" to item.toString(),
|
||||
"ChannelId" to channel.toString(),
|
||||
"ProgramInfo" to Json.Default.encodeToString(programInfo),
|
||||
"ProgramInfo" to Json.encodeToString(programInfo),
|
||||
)
|
||||
|
||||
// TODO only pass item id instead of complete JSON to browsing destinations
|
||||
fun seriesTimerDetails(item: UUID, seriesTimer: SeriesTimerInfoDto) =
|
||||
fragmentDestination<FullDetailsFragment>(
|
||||
"ItemId" to item.toString(),
|
||||
"SeriesTimer" to Json.Default.encodeToString(seriesTimer),
|
||||
"SeriesTimer" to Json.encodeToString(seriesTimer),
|
||||
)
|
||||
|
||||
fun itemList(item: UUID) = fragmentDestination<ItemListFragment>(
|
||||
|
||||
Reference in new issue
Block a user