Fixes #306, load playlists from server-local directory #307
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.
This is a naïve implementation of loading playlists from a directory on the server. It adds a configuration option for telling the server where the directory of playlists is, and it will (recursively) load any
.m3u
and.m3u8
files it finds there. The playlists are added under the default admin user, and are set public.Playlists are loaded into the DB as if they'd been uploaded by the user through the UI. The code for doing so was reused; the biggest change was relocating the code that does that from the
ctrladmin
package to thescanner
package.As discussed in #306, this may not be the way gonic wants to handle playlists going forward; however, that sort of change would (a) require more discussion and/or design, and (b) be a lot bigger. I believe that this PR would neither impede nor make such a more radical design change more difficult to implement, and as it addresses the request I'm submitting it even though it may not be the ideal, ultimate design.