Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple Music Folders #192

Open
chrstn-hntschl opened this issue Apr 19, 2020 · 55 comments
Open

Multiple Music Folders #192

chrstn-hntschl opened this issue Apr 19, 2020 · 55 comments

Comments

@chrstn-hntschl
Copy link

Is it possible to have navidrome manage separate folders on a user level? So for example, user A has access to all music files in folderA, user B has access to all music in folderB and user C has access to folderA and folderB? I am asking because I want to separate music from audiobooks and don't want to have all mixed up in the same view.

@deluan
Copy link
Member

deluan commented Apr 19, 2020

Thanks for trying Navidrome!

Right now it only supports one music folder. Once multiple folders are implemented, access restrictions will be supported.

@SteveDinn
Copy link

Came here to add this feature request, and found this one. This is the one feature preventing me from moving from Airsonic to Navidrome.

@cascooscuro
Copy link

would it be possible to have this functionality implemented similarly as subsonic/airsonic does?
Let me explain it. In subsonic, when you select a folder, you get a view restricted to the albums/artists in that location. Those like me who come from subsonic have been curating our libraries using some sort of folder structure. Having this functionality will really help when we migrate.
Thanks!

@deluan
Copy link
Member

deluan commented Oct 5, 2020

Yep, this is how it will work, and you are going to have different permissions and other settings for each music folder.

@Mycah
Copy link

Mycah commented Nov 30, 2020

Just found this as airsonic seems dead, but I already like this way more. Would love to see this feature added. Thanks for the awesome program.

@quotengrote
Copy link

Hi, thats the feature i am missing the most.
Anyone want to ship in in a bounty?

@deluan THX for Navidrome!

@Tuphal
Copy link

Tuphal commented Jun 17, 2021

Hi, this feature will be really nice to have.
For example my wife has a different music folder, than me. Therefore 2 seperate libraries would be best.
I would financially support a bounty.

@mayanez
Copy link
Contributor

mayanez commented Aug 17, 2021

I'd also be willing to support a bounty. Alternatively, I'd be willing to help out with the implementation as well. I'm not at all familiar with the codebase and what it would entail, but maybe if one of the maintainers could point me in the right direction I'd be happy to take a look.

@certuna
Copy link
Contributor

certuna commented Aug 18, 2021

It's not a super trivial thing. I think, from the top of my head, there's at least the following steps (please correct me if I'm wrong):

Create new database table base_folder with id (a UUID), path ("/path/to/folder1") and name (to give it a fancy name "Harry's Audiobooks Folder")

Write the server code to pick up the (comma separated?) list of base folders from the configfile and populate this table

New database table base_folder_access that maps users to base folders, with columns user_id and base_folder_id (the primary keys of these tables)

Create a folders API endpoint to allow the web UI to read/modify this table

Write the web UI code to allow admins to populate this table (ie, assign base folders to users, enter the fancy name), but DO NOT ALLOW THE API TO CREATE A NEW BASE FOLDER - SECURITY RISK!

Add to the media_file table:

  • new field base_folder_id, the UUID that references the base folder
  • new field relative_path ("/path/to/mediafile.mp3") that stores the relative path of the file, constructed by stripping the base folder path from the mediafile's path field (which would be "/path/to/folder1/path/to/mediafile.mp3")

Change the scanner so it populates these fields correctly, and ideally "intelligent" enough that when the base folder changes but the relative path stays the same (ie, a user moves his whole music folder to a new location), ND doesn't create new records for each song but just updates the base_folder_id and path.

Change all the relevant SQL queries to filter for only the base folders that the user has access to (that's relatively trivial for songs, but you also want to filter out all artists and albums (and genres) that the user has no access to.

Probably: add relativePath and baseFolderName to the song API endpoint and remove path (fixes #959 )

@Zetten
Copy link

Zetten commented Nov 8, 2021

I saw that gonic recently resolved a similar issue, which may offer some hints as to the design.

@deluan
Copy link
Member

deluan commented Nov 14, 2021

Thanks for the link. The internal structure of Gonic is very different from Navidrome, so the changes do not apply to ND. I already started working on this, but put it on hold to focus on Smart Playlists, a more important feature (at least for me personally 😉 )

@loneboat
Copy link

loneboat commented Jan 7, 2022

@loneboat
Copy link

loneboat commented Jan 8, 2022

Super please! This is so far the only feature that's keeping me from moving full-time to Navidrome.

@bachig26
Copy link

bachig26 commented Jan 22, 2022

@deluan if enabling the multiple musicfolder path option is difficult or takes time to work it at the moment. is it possible to an argument or some function to provide different paths to different user profile? so that the different folders can be linked to different user profile to make this a closer to solve in a different way.

@ps-gill
Copy link

ps-gill commented Oct 6, 2023

@ps-gill If I were to want to try this out on a test server, in your opinion is there anything stopping me from just building your fork?

Nothing really. The fork just allows one to specify multiple music folders e.g. ./navidrome --musicfolder foo --musicfolder bar.

In addition to specifying multiple folders, community seems to be looking for isolating music folders by users. I was planning to work towards that but haven't had a chance to take a stab at it.

@comatory
Copy link

I have a slightly different use case. I'd like to keep audiobooks & podcasts in separate folder. I know I could probably solve this with tagging but it would not improve browsing experience I think.
I also have NAS running Navidrome and would like to have just one instance running due to limits on CPU & RAM.

@luk6173
Copy link

luk6173 commented Apr 27, 2024

In addition to specifying multiple folders, community seems to be looking for isolating music folders by users. I was planning to work towards that but haven't had a chance to take a stab at it.

any news here? Would be great to see this feature very soon

@0xa48rx394r83e9
Copy link

This appears to be a very fascinating feature, and I am willing to look into its implementation; however, I would need to first confirm a few details. One, is the bounty still active, and two, what exactly are you looking for (current consensus is that you want an additional option to be able to select multiple folders, but is there anything specific you want here, such as things from different folders having different tags, or are they all supposed to be treated as if they are from one folder, or do you want some sort of hybrid between those two).

@Flameborn
Copy link

Personally, I imagine this feature as having a root folder that lists all the added folders a user has permission to access, but only if multiple folders can be accessed. For example, if a user has access to the Music folder only, the first level should be the contents of that folder. If a user has multiple folders added, e.g. Music, Audio Dramas, Audio Books, then those should be displayed first.

When a specific folder is selected, e.g. Audio Books, tags should apply to anything within that folder only, similarly to when a user has access to one folder only.

@deluan
Copy link
Member

deluan commented May 25, 2024

Hey @0xa48rx394r83e9, thanks for chiming in, but this feature cannot be implemented now, as I'm working on a big refactor that will change a lot of the internals. When I'm done, it will be easier to implement this feature (at least in the server).

@0xa48rx394r83e9
Copy link

@deluan understood, thanks for the quick response.

@praveensg8
Copy link

I have multiple folders in my Hard disk which i had added to my navidrome music folder. But its not getting added all the files to the library.It stops at certain point. Please advise how this issue can be sorted out. I have very minimum knowledge of programming. SO your help would be very much apprciated.
HDDfolders

@Mizuho32
Copy link

Mizuho32 commented Jul 12, 2024

I implemented sample of artist-based album access control for Web UI. It seems to work in my local environment.
Mizuho32@5b3cc07
Mizuho32@b1c59c7

Can be combined with #192 (comment) ...?

@rpgdev
Copy link

rpgdev commented Oct 14, 2024

I just want to have two different libraries one for say Soundtracks and another one for Classical (just examples), is there a way that we can have that first before we complicate it with access control logic? That's probably harder than the libraries logic. Right now the only solution for this is firing up another navidrome server.

@deluan
Copy link
Member

deluan commented Oct 18, 2024

The library segregation is actually way harder than the access control, but the foundational work is being considered in #2709

@Szeraax Szeraax moved this to To-do in Navidrome roadmap Nov 12, 2024
@Szeraax Szeraax added this to the Big Refactor milestone Nov 12, 2024
@deluan deluan removed this from the Big Refactor milestone Nov 27, 2024
@raphmim
Copy link

raphmim commented Jan 16, 2025

Very excited to see this on the roadmap! My Navidrome server will finally become a music cloud for all my family members :)

@TheOnlyJoey
Copy link

Just wanted to add a particular usecase for people in music production (that would apply for me).
I run a music production company, and a folder/user isolation system would be quite useful for getting my clients individual login's with only access to their own respective files.
This makes it incredible for a private infrastructure for studio's where you can easily share in progress mixes or end productions, while having everything easily accessible and playable.

@funkybside
Copy link

funkybside commented Feb 2, 2025

2nd this request - started using navidrome recently and was surprised it's limited to a single library folder. I have users that manually put music into cache locations on their personal user shares, and also a shared location used by automations. My users would prefer to have their instances see their private external collection + the shared collection. Will likely use plex for the time being, but I'll keep navidrome going for myself to follow its development.

@Daviid-P
Copy link

Not sure if this is related or it just seems like it to me because of my folder structure but how about blacklisting Artists/Albums from being served to a user?

In my setup I have:

📁 Root Folder: Music

  • 📂 Artist 1

    • 📂 Album 1 (Year)
      • 🎵 Track 1
      • 🎵 Track 2
      • 🎵 Track 3
    • 📂 Album 2 (Year)
      • 🎵 Track 1
      • 🎵 Track 2
  • 📂 Artist 2

    • 📂 Album 1 (Year)
      • 🎵 Track 1
      • 🎵 Track 2
      • 🎵 Track 3
    • 📂 Album 2 (Year)
      • 🎵 Track 1
      • 🎵 Track 2
      • 🎵 Track 3
  • 📂 Artist 3

    • 📂 Album 1 (Year)
      • 🎵 Track 1
      • 🎵 Track 2

So if for some reason I allow my parents to download music to my Lidarr/Navidrome setup I'd like to be able to blacklist Willie Nelson while my parents would like to blacklist Sabatton.

But maybe that's easier as a separate filter? I assume a separate filter could be improved to filter Artists name, Album name, Genre, etc...

@tcurdt
Copy link
Contributor

tcurdt commented Feb 10, 2025

Not sure if this is related or it just seems like it to me because of my folder structure but how about blacklisting Artists/Albums from being served to a user?

Not sure that is enough though.
For me it's about music and audiobooks.
Mixing them in a single folder and then use blacklisting - I don't see that working well.

@humanspida
Copy link

I'm still using multiple instances in docker to segregate my libraries - then I can add them to the Symphonium app on my android phone or tablet...
it's not perfect, but it works well enough for now while this multi-library feature is in the works.
I currently have 3 instances/libraries in use: one for my ambient music, one for my rap & hiphop music, and one for my dad to use for his music.
At the moment, I just spin up more docker containers/instances as required - they're not all that taxing on my NAS resources so it's fine as a temporary solution.
Am defo looking forward to being able to consolidate things though.

@raphmim
Copy link

raphmim commented Feb 20, 2025

I have a question about the vision for this.

I know at a basic level the idea is to simply pull different libraries into the same server, and manage access (eg. user A only has access to folder X, user B only has access to folder Y, user C has access to both folders X and Y).

But is the idea to go further and, for example, allow user A to share album i (pulled from folder X) with user B? So that album i will show up in user B's library and user B can add it to their playlists.

@deluan
Copy link
Member

deluan commented Feb 20, 2025

But is the idea to go further and, for example, allow user A to share album i (pulled from folder X) with user B? So that album i will show up in user B's library and user B can add it to their playlists.

This is too complex too handle and not something that lots of users will end up using. Not even Plex implement such fine grained permission system.

Remember: First and foremost Navidrome is a personal server, so the admin can create a "public" folder S with all shared albums that should be seen by all users, and add that folder to the list of permitted folders when creating new users.

@raphmim
Copy link

raphmim commented Feb 20, 2025

Got it @deluan, makes sense. Then the ability to follow another user's public playlist would probably address my needs anyway in terms of sharing

@rcv11x
Copy link

rcv11x commented Feb 24, 2025

I would love to see this feature, I know that navidrome is for personal use but it would be great and (taking advantage that there is already user support) that I for example create a user for my sister and she has her own music folder separate from mine so she has her own music and the same for my father / mother, I look forward to this feature, good job!

@textuneser
Copy link

I would really like this possibility in stead of having to creat two docker containers, in my case: One for mp3 and another for flac

@deluan
Copy link
Member

deluan commented Mar 14, 2025

This is something I'll be working on next 👍🏼

@Flameborn
Copy link

Flameborn commented Mar 14, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Picked
Development

No branches or pull requests