<?xml version="1.0" encoding="utf-8"?>
<navigation xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/main_nav_graph"
    app:startDestination="@+id/homeFragment">
    <fragment
        android:label="Home"
        android:name="com.strmr.ps.ui.home.HomeFragment"
        android:id="@+id/homeFragment">
        <action
            android:id="@+id/action_home_to_details"
            app:destination="@+id/detailsFragment"/>
        <action
            android:id="@+id/action_home_to_genre"
            app:destination="@+id/genreFragment"/>
        <action
            android:id="@+id/action_home_to_traktList"
            app:destination="@+id/traktListFragment"/>
        <action
            android:id="@+id/action_home_to_traktMedia"
            app:destination="@+id/traktMediaFragment"/>
    </fragment>
    <fragment
        android:label="Movies"
        android:name="com.strmr.ps.ui.movies.MoviesFragment"
        android:id="@+id/moviesFragment">
        <action
            android:id="@+id/action_movies_to_details"
            app:destination="@+id/detailsFragment"/>
        <action
            android:id="@+id/action_movies_to_genre"
            app:destination="@+id/genreFragment"/>
    </fragment>
    <fragment
        android:label="TV Shows"
        android:name="com.strmr.ps.ui.tvshows.TvShowsFragment"
        android:id="@+id/tvShowsFragment">
        <action
            android:id="@+id/action_tvShows_to_details"
            app:destination="@+id/detailsFragment"/>
    </fragment>
    <fragment
        android:label="Search"
        android:name="com.strmr.ps.ui.search.SearchFragment"
        android:id="@+id/searchFragment">
        <action
            android:id="@+id/action_search_to_details"
            app:destination="@+id/detailsFragment"/>
    </fragment>
    <fragment
        android:label="Library"
        android:name="com.strmr.ps.ui.library.DebridLibraryFragment"
        android:id="@+id/libraryFragment"/>
    <fragment
        android:label="Details"
        android:name="com.strmr.ps.ui.details.DetailsFragment"
        android:id="@+id/detailsFragment">
        <argument
            android:name="tmdb_id"
            app:argType="integer"/>
        <argument
            android:name="content_type"
            app:argType="string"/>
        <argument
            android:name="content_item"
            android:defaultValue="@null"
            app:argType="com.strmr.ps.data.model.ContentItem"
            app:nullable="true"/>
        <action
            android:id="@+id/action_details_to_actor"
            app:destination="@+id/actorDetailsFragment"/>
        <action
            android:id="@+id/action_details_to_details"
            app:destination="@+id/detailsFragment"
            app:popUpTo="@+id/detailsFragment"
            app:popUpToInclusive="true"/>
    </fragment>
    <fragment
        android:label="Actor Details"
        android:name="com.strmr.ps.ui.actor.ActorDetailsFragment"
        android:id="@+id/actorDetailsFragment">
        <argument
            android:name="person_id"
            app:argType="integer"/>
        <argument
            android:name="person_name"
            android:defaultValue=""
            app:argType="string"/>
        <argument
            android:name="origin_content"
            android:defaultValue="@null"
            app:argType="com.strmr.ps.data.model.ContentItem"
            app:nullable="true"/>
        <action
            android:id="@+id/action_actor_to_details"
            app:destination="@+id/detailsFragment"/>
    </fragment>
    <fragment
        android:label="Genre"
        android:name="com.strmr.ps.ui.genre.GenreFragment"
        android:id="@+id/genreFragment">
        <argument
            android:name="genre_slug"
            app:argType="string"/>
        <argument
            android:name="genre_name"
            app:argType="string"/>
        <action
            android:id="@+id/action_genre_to_details"
            app:destination="@+id/detailsFragment"/>
    </fragment>
    <fragment
        android:label="Trakt List"
        android:name="com.strmr.ps.ui.traktlist.TraktListFragment"
        android:id="@+id/traktListFragment">
        <argument
            android:name="trakt_list_username"
            app:argType="string"/>
        <argument
            android:name="trakt_list_id"
            app:argType="string"/>
        <argument
            android:name="trakt_list_title"
            android:defaultValue="Trakt List"
            app:argType="string"/>
        <argument
            android:name="trakt_list_url"
            android:defaultValue=""
            app:argType="string"/>
        <action
            android:id="@+id/action_traktList_to_details"
            app:destination="@+id/detailsFragment"/>
    </fragment>
    <fragment
        android:label="Trakt Media"
        android:name="com.strmr.ps.ui.traktmedia.TraktMediaFragment"
        android:id="@+id/traktMediaFragment">
        <argument
            android:name="trakt_media_category"
            app:argType="string"/>
        <action
            android:id="@+id/action_traktMedia_to_details"
            app:destination="@+id/detailsFragment"/>
    </fragment>
    <action
        android:id="@+id/action_global_to_details"
        app:destination="@+id/detailsFragment"/>
    <action
        android:id="@+id/action_global_to_genre"
        app:destination="@+id/genreFragment"/>
    <action
        android:id="@+id/action_global_to_traktList"
        app:destination="@+id/traktListFragment"/>
    <action
        android:id="@+id/action_global_to_traktMedia"
        app:destination="@+id/traktMediaFragment"/>
</navigation>
