This commit is contained in:
Jesse Bannon 2025-05-08 20:07:28 -07:00
parent 657ebee4aa
commit a5e6b1ab6f
2 changed files with 93 additions and 41 deletions

View file

@ -28,23 +28,18 @@ Plex
---------------------------------------------- ----------------------------------------------
Generic Presets
===============
There are two main methods for downloading and formatting videos as a TV show.
TV Show by Date TV Show by Date
--------------- ===============
TV Show by Date will organize something like a YouTube channel or playlist into a tv show, where seasons and episodes are organized using upload date. TV Show by Date will organize something like a YouTube channel or playlist into a tv show, where seasons and episodes are organized using upload date.
Example Example
~~~~~~~ -------
Must define ``tv_show_directory``. Available presets: Must define ``tv_show_directory``. Available presets:
* ``"Kodi TV Show by Date"`` * ``Kodi TV Show by Date``
* ``"Jellyfin TV Show by Date"`` * ``Jellyfin TV Show by Date``
* ``"Plex TV Show by Date"`` * ``Plex TV Show by Date``
.. code-block:: yaml .. code-block:: yaml
@ -72,7 +67,7 @@ Must define ``tv_show_directory``. Available presets:
- "https://www.youtube.com/@rickbeato240" - "https://www.youtube.com/@rickbeato240"
Advanced Usage Advanced Usage
~~~~~~~~~~~~~~ --------------
If you prefer a different season/episode organization method, you can set the following override variables. If you prefer a different season/episode organization method, you can set the following override variables.
@ -93,16 +88,19 @@ Or for a specific preset
tv_show_by_date_season_ordering: "year-month" tv_show_by_date_season_ordering: "year-month"
tv_show_by_date_episode_ordering: "day" tv_show_by_date_episode_ordering: "day"
The following are supported. The following are supported. Be sure the combined season + episode ordering
include the year, month, day, i.e. upload-year + upload-month-day.
**tv_show_by_date_season_ordering** ``tv_show_by_date_season_ordering``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* upload-year * upload-year
* upload-year-month * upload-year-month
* release-year * release-year
* release-year-month * release-year-month
**tv_show_by_date_episode_ordering** ``tv_show_by_date_episode_ordering``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* upload-day * upload-day
* upload-month-day * upload-month-day
@ -116,9 +114,15 @@ The following are supported.
* Episodes are numbered by the download order. **NOTE**: this is fetched using the length of the download archive. Do not use if you intend to remove old videos. * Episodes are numbered by the download order. **NOTE**: this is fetched using the length of the download archive. Do not use if you intend to remove old videos.
TV Show by Date presets use the following for defaults:
.. code-block:: yaml
tv_show_by_date_season_ordering: "upload-year"
tv_show_by_date_episode_ordering: "upload-month-day"
TV Show Collection TV Show Collection
------------------ ==================
TV Show Collections set each URL as its own season. If a video belongs to multiple URLs TV Show Collections set each URL as its own season. If a video belongs to multiple URLs
(i.e. a channel and a channel's playlist), the video will only download once and reside in (i.e. a channel and a channel's playlist), the video will only download once and reside in
@ -132,12 +136,12 @@ Two main use cases of a collection are:
represents a separate channel/playlist. represents a separate channel/playlist.
Example Example
~~~~~~~ -------
Must define ``tv_show_directory``. Available presets: Must define ``tv_show_directory``. Available presets:
* ``"Kodi TV Show Collection"`` * ``Kodi TV Show Collection``
* ``"Jellyfin TV Show Collection"`` * ``Jellyfin TV Show Collection``
* ``"Plex TV Show Collection"`` * ``Plex TV Show Collection``
.. code-block:: yaml .. code-block:: yaml
@ -155,21 +159,41 @@ Must define ``tv_show_directory``. Available presets:
s02_url: "https://www.youtube.com/playlist?list=PLE62gWlWZk5NWVAVuf0Lm9jdv_-_KXs0W" s02_url: "https://www.youtube.com/playlist?list=PLE62gWlWZk5NWVAVuf0Lm9jdv_-_KXs0W"
Advanced Usage Advanced Usage
~~~~~~~~~~~~~~ --------------
If you prefer a different organization method, you can instead apply multiple presets to your subscriptions. If you prefer a different episode organization method, you can set the following override variables.
You will need a base of one of the below: .. code-block:: yaml
* ``kodi_tv_show_collection`` __preset__:
* ``jellyfin_tv_show_collection`` overrides:
* ``plex_tv_show_collection`` tv_show_directory: "/tv_shows"
tv_show_collection_episode_ordering: "release-year-month-day"
And then add one of these: Or for a specific preset
* ``season_by_collection__episode_by_year_month_day`` .. code-block:: yaml
* ``season_by_collection__episode_by_year_month_day_reversed``
* ``season_by_collection__episode_by_playlist_index`` "~Beyond the Guitar":
tv_show_collection_episode_ordering: "release-year-month-day"
* Only use playlist_index episode formatting for playlists that will be fully downloaded once and never again. Otherwise, indices can change. s01_name: "Videos"
* ``season_by_collection__episode_by_playlist_index_reversed`` s01_url: "https://www.youtube.com/c/BeyondTheGuitar"
s02_name: "Covers"
s02_url: "https://www.youtube.com/playlist?list=PLE62gWlWZk5NWVAVuf0Lm9jdv_-_KXs0W"
The following are supported.
``tv_show_collection_episode_ordering``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* upload-year-month-day
* upload-year-month-day-reversed
* release-year-month-day
* release-year-month-day-reversed
* playlist-index
* Only use playlist-index episode formatting for playlists that will be fully downloaded once and never again. Otherwise, indices can change.
* playlist-index-reversed
TV Show Collection presets use upload-year-month-day as the default.

View file

@ -37,25 +37,53 @@ presets:
############################### ###############################
season_by_collection__episode_by_year_month_day: _tv_show_collection_episode_ordering:
overrides: overrides:
episode_number: "{upload_year_truncated}{upload_month_padded}{upload_day_padded}{upload_date_index_padded}" tv_show_collection_episode_ordering: >-
episode_number_padded: "{episode_number}" { %throw("Must specify tv_show_collection_episode_ordering") }
"%episode_ordering_": >-
{ %eq( %lower(tv_show_collection_episode_ordering), $0 ) }
episode_number_and_padded_: >-
{
%elif(
%episode_ordering_( "upload-year-month-day" ), [ %concat(upload_year_truncated, upload_month_padded, upload_day_padded, upload_date_index_padded), 8 ],
%episode_ordering_( "upload-year-month-day-reversed" ), [ %concat(upload_year_truncated_reversed, upload_month_reversed_padded, upload_day_reversed_padded, upload_date_index_reversed_padded), 8],
%episode_ordering_( "release-year-month-day" ), [ %concat(release_year_truncated, release_month_padded, release_day_padded, upload_date_index_padded), 8 ],
%episode_ordering_( "release-year-month-day-reversed" ), [ %concat(release_year_truncated_reversed, release_month_reversed_padded, release_day_reversed_padded, upload_date_index_reversed_padded), 8],
%episode_ordering_( "playlist-index" ), [ %concat(playlist_index), 6],
%episode_ordering_( "playlist-index-reversed" ), [ %concat(playlist_index_reversed), 6],
%throw(
'tv_show_collection_episode_ordering must be one of the following: "upload-year-month-day", "upload-year-month-day-reversed", "release-year-month-day", "release-year-month-day-reversed", "playlist-index", "playlist-index-reversed"'
)
)
}
episode_number: "{ %array_at(episode_number_and_padded_, 0) }"
episode_number_padded: "{ %pad_zero( %int(episode_number), %int(%array_at(episode_number_and_padded_, 1))) }"
### LEGACY PRESETS
season_by_collection__episode_by_year_month_day:
preset: "_tv_show_collection_episode_ordering"
overrides:
tv_show_collection_episode_ordering: "upload-year-month-day"
season_by_collection__episode_by_year_month_day_reversed: season_by_collection__episode_by_year_month_day_reversed:
preset: "_tv_show_collection_episode_ordering"
overrides: overrides:
episode_number: "{upload_year_truncated_reversed}{upload_month_reversed_padded}{upload_day_reversed_padded}{upload_date_index_reversed_padded}" tv_show_collection_episode_ordering: "upload-year-month-day-reversed"
episode_number_padded: "{episode_number}"
season_by_collection__episode_by_playlist_index: season_by_collection__episode_by_playlist_index:
preset: "_tv_show_collection_episode_ordering"
overrides: overrides:
episode_number: "{playlist_index}" tv_show_collection_episode_ordering: "playlist-index"
episode_number_padded: "{playlist_index_padded6}"
season_by_collection__episode_by_playlist_index_reversed: season_by_collection__episode_by_playlist_index_reversed:
preset: "_tv_show_collection_episode_ordering"
overrides: overrides:
episode_number: "{playlist_index_reversed}" tv_show_collection_episode_ordering: "playlist-index-reversed"
episode_number_padded: "{playlist_index_reversed_padded6}"
############## ##############