Proposal: Add configurable download subdirectory templating#125
Open
paubineau wants to merge 1 commit into
Open
Proposal: Add configurable download subdirectory templating#125paubineau wants to merge 1 commit into
paubineau wants to merge 1 commit into
Conversation
04b527a to
082e04d
Compare
f56ae50 to
df1f630
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
My goal is to allow Explo downloads to use a media-server-friendly folder layout, such as
{artist}/{album}, so the Explo collection displays correctly in Jellyfin while still supporting non-persistent playlists.DOWNLOAD_SUBDIRECTORY_FORMATto customize download subfolders whenUSE_SUBDIRECTORY=true{playlist},{artist}, and{album}tokens, with{playlist}preserving the existing default behaviorUSE_SUBDIRECTORY=false{playlist}rootalbum_artistmetadata for YouTube downloads to improve media server groupingNotes:
DOWNLOAD_SUBDIRECTORY_FORMATis ignored unlessUSE_SUBDIRECTORY=true.Formats rooted by
{playlist}keep the existing cleanup behavior: non-persistent runs delete that playlist's download folder.For formats that do not start with
{playlist}, Explo cannot safely delete an entire playlist folder anymore because files from different playlists may share the same artist/album folders. In that case, Explo stores a per-playlist cleanup record underplaylist-manifestsand only removes files that are no longer referenced by another Explo playlist.The cleanup implementation is split into path/template helpers (paths.go) and playlist-manifest helpers (manifest.go): path helpers resolve the configured subdirectory format safely, while playlist manifests track which downloaded files belong to each playlist when multiple playlists share the same artist/album folders.
Playlist cleanup only tracks files created by Explo during a run, or files already known from another Explo playlist manifest. Existing user-library files are not claimed for cleanup.
Possible split:
If this PR is not something you want to merge because of the added complexity, the Jellyfin-related changes may still be worth considering separately:
album_artistmetadata for YouTube downloads to improve media server groupingThese changes are independent from the configurable subdirectory feature and improve how Explo-downloaded tracks are grouped and displayed with artwork in Jellyfin.
Disclosure:
I used AI assistance (Codex) to speed up implementation while preparing this PR. I reviewed and tested all changes before submitting.