[GH-ISSUE #647] Hybrid backend for song storage/streaming #462

Closed
opened 2026-02-26 02:33:17 +03:00 by kerem · 2 comments
Owner

Originally created by @DeftNerd on GitHub (Aug 29, 2017).
Original GitHub issue: https://github.com/koel/koel/issues/647

I run a server on a provider and also have access to a large S3-compatible storage system at the same provider. It's not AWS, so it doesn't have Lambda.

Adding music to the S3 system won't trigger the Lambda function to update the Koel database with the new addition, but I can mount the S3 bucket to the local filesystem using s3fs.

Would I would love to have is a backend choice where you can select a directory for scanning and music detection, but also specify a URL schema prefix to supply to clients.

So if the root scanning directory is /mnt/music and the URL prefix might be https://bucket.someprovider.com then "/mnt/music/Artist Name/Album Name/01 - Song Name.mp3" would be pushed to the client as "https://bucket.someprovider.com/Artist Name/Album Name/01 - Song Name.mp3"

This edge case might also be useful for people who have NAS on their network that stores the music and then a different machine that runs the Koel software. It would allow the music to be streamed directly from the NAS without passing through the Koel server machine.

Originally created by @DeftNerd on GitHub (Aug 29, 2017). Original GitHub issue: https://github.com/koel/koel/issues/647 I run a server on a provider and also have access to a large S3-compatible storage system at the same provider. It's not AWS, so it doesn't have Lambda. Adding music to the S3 system won't trigger the Lambda function to update the Koel database with the new addition, but I can mount the S3 bucket to the local filesystem using s3fs. Would I would love to have is a backend choice where you can select a directory for scanning and music detection, but also specify a URL schema prefix to supply to clients. So if the root scanning directory is /mnt/music and the URL prefix might be https://bucket.someprovider.com then "/mnt/music/Artist Name/Album Name/01 - Song Name.mp3" would be pushed to the client as "https://bucket.someprovider.com/Artist Name/Album Name/01 - Song Name.mp3" This edge case might also be useful for people who have NAS on their network that stores the music and then a different machine that runs the Koel software. It would allow the music to be streamed directly from the NAS without passing through the Koel server machine.
kerem closed this issue 2026-02-26 02:33:17 +03:00
Author
Owner

@DeftNerd commented on GitHub (Aug 29, 2017):

Actually, after some thought, I think it might be better to just use the Laravel storage system more fully when it comes to song storage.

Laravel lets you specify multiple storage disk configurations in config/storage.php

Koel could be extended to use multiple disk configurations that can be called fluently.

You could allow for different configurations for upload, scanning, and playback configurations. By default they could all be identical so one set of config values in the .env file would configure all of them, but users could specify different configurations at will.

Upload would be the directory that uploaded music gets placed in. Once uploaded, it could trigger a series of configurable queue jobs such as:

  • unpacking the upload if it's a compressed archive
  • removing non-music files (.nfo, .pdf, .lnk, etc)
  • examine the files for metadata and search music API for a match
  • rename and move the files to a standard format and in a standard directory structure
  • write metadata to the db
  • download album art and store alongside the music in a standard format
  • transcodes the songs if they aren't in a format or quality set by the user
  • move the songs to the scanning storage location.

The scanning storage location would be another Laravel storage subsystem configuration. It might be a mounted FTP site, S3 bucket, local filesystem location, or anything else supported flysystem library.

The playback storage subsystem configuration would often be the same as the scanning storage configuration, but sometimes it might be different.

<!-- gh-comment-id:325815897 --> @DeftNerd commented on GitHub (Aug 29, 2017): Actually, after some thought, I think it might be better to just use the Laravel storage system more fully when it comes to song storage. Laravel lets you specify multiple storage disk configurations in config/storage.php Koel could be extended to use [multiple disk configurations that can be called fluently](https://laravel.com/docs/5.4/filesystem#configuration). You could allow for different configurations for upload, scanning, and playback configurations. By default they could all be identical so one set of config values in the .env file would configure all of them, but users could specify different configurations at will. Upload would be the directory that uploaded music gets placed in. Once uploaded, it could trigger a series of configurable queue jobs such as: * unpacking the upload if it's a compressed archive * removing non-music files (.nfo, .pdf, .lnk, etc) * examine the files for metadata and search music API for a match * rename and move the files to a standard format and in a standard directory structure * write metadata to the db * download album art and store alongside the music in a standard format * transcodes the songs if they aren't in a format or quality set by the user * move the songs to the scanning storage location. The scanning storage location would be another Laravel storage subsystem configuration. It might be a mounted FTP site, S3 bucket, local filesystem location, or anything else supported flysystem library. The playback storage subsystem configuration would often be the same as the scanning storage configuration, but sometimes it might be different.
Author
Owner

@phanan commented on GitHub (Aug 30, 2017):

I don't really get it – is it something a symlink can do just fine?

<!-- gh-comment-id:325980246 --> @phanan commented on GitHub (Aug 30, 2017): I don't really get it – is it something a symlink can do just fine?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/koel-koel#462
No description provided.