From 47219578754e6098016726495745f98d2a9e6202 Mon Sep 17 00:00:00 2001 From: Kieran Date: Tue, 16 Apr 2024 16:54:55 -0700 Subject: [PATCH] Added yt-dlp options for year formatting (#188) --- lib/pinchflat/downloading/download_option_builder.ex | 10 ++++++++-- .../downloading/download_option_builder_test.exs | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/pinchflat/downloading/download_option_builder.ex b/lib/pinchflat/downloading/download_option_builder.ex index 69fd061..5dc1bb2 100644 --- a/lib/pinchflat/downloading/download_option_builder.ex +++ b/lib/pinchflat/downloading/download_option_builder.ex @@ -42,8 +42,14 @@ defmodule Pinchflat.Downloading.DownloadOptionBuilder do end defp default_options do - # Add force-overwrites to make sure redownloading works - [:no_progress, :windows_filenames, :force_overwrites] + [ + :no_progress, + :windows_filenames, + # Add force-overwrites to make sure redownloading works + :force_overwrites, + # This makes the date metadata conform to what jellyfin expects + parse_metadata: "%(upload_date>%Y-%m-%d)s:(?P.+)" + ] end defp subtitle_options(media_profile) do diff --git a/test/pinchflat/downloading/download_option_builder_test.exs b/test/pinchflat/downloading/download_option_builder_test.exs index d5c4dab..8ce35a2 100644 --- a/test/pinchflat/downloading/download_option_builder_test.exs +++ b/test/pinchflat/downloading/download_option_builder_test.exs @@ -55,6 +55,7 @@ defmodule Pinchflat.Downloading.DownloadOptionBuilderTest do assert :no_progress in res assert :windows_filenames in res assert :force_overwrites in res + assert {:parse_metadata, "%(upload_date>%Y-%m-%d)s:(?P.+)"} in res end end