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

Question about volumes and directories #48

Closed
Rom0067 opened this issue Nov 18, 2024 · 5 comments
Closed

Question about volumes and directories #48

Rom0067 opened this issue Nov 18, 2024 · 5 comments

Comments

@Rom0067
Copy link

Rom0067 commented Nov 18, 2024

I am just getting started in the world of selfhosting music and beets. I have deployed this image but Im really confused and having trouble getting things working. No disrespect but I feel like the documentation is not very beginner friendly. Im hoping someone could help me out a little as I think I'm close to getting it working.

I currently have music stored on machine at /mnt/storage/music and I would like all beets tagged music to be moved to /mnt/storage/Library. I am unsure what "inbox" means in the example compose file volumes. I'm also guessing that "clean" is where I would want my "Library" folder. When I try setting those volumes in the compose/config, I can see music on the gui in the "awesome Library" but when I initialize tagging it spins indefinitely with no changes to music files. I only have 10 albums right now to keep things simple while I learn all the different hosting apps. Also while it's spinning I get errors when I click other tabs in the GUI but no info when I click view error. The logs are also not showing any errors. Lastly I did set locations in the config files however I may have gotten something wrong. Any help is greatly appreciated sorry for the wall of text. Feel free to close this issue if it was inappropriate to ask this here. Thank you!

@pSpitzner
Copy link
Owner

pSpitzner commented Nov 18, 2024

Hi Rom,

glad to hear you are giving this a shot, and sorry the documentation did not get you all the way.

The inbox is the folder where you place new albums that you want to add. (Start with the easy case where each folder is one album). Each album-folder within a configured inbox will show up in the gui.

To add an inbox, you need to do two things:
i) in your docker compose, mount the folder into the container
ii) in the gui config file (mounted to /config/beets-flask/config.yaml), add the inbox path.

For example, lets say you want to use /mnt/storage/music for everything.

  1. create the following three folders on your host
  • /mnt/storage/music/inbox where you place new albums
  • /mnt/storage/music/library where your imported, cleaned and tagged music files will be moved
  • /mnt/storage/music/config where the beets library will be created, and your configs can be edited.
  1. Edit you docker compose to mount them,
services:
    beets-flask:
        image: pspitzner/beets-flask:latest
        restart: unless-stopped
        ports:
            - "5001:5001"
        environment:
            # 502 is default on macos, 1000 on linux (use `id` in a terminal to find out)
            USER_ID: 1000
            GROUP_ID: 1000
        volumes:
            - /mnt/storage/music/config/:/config
            - /mnt/storage/music/library/:/mnt/storage/music/library/
            - /mnt/storage/music/inbox/:/mnt/storage/music/inbox
  1. Start the container (docker compose -f /path/to/your/compose.yaml up). This will create the default config files at /mnt/storage/music/config/beets/config.yaml and /mnt/storage/music/config/beets-flask/config.yaml.

  2. Edit /mnt/storage/music/config/beets-flask/config.yaml, to include your inbox folder:

gui:
    num_workers_preview: 4

    library:
        readonly: no

    tags:
        expand_tags: yes
        recent_days: 14
        order_by: "name" # or "date_created" | "date_modified"
        show_unchanged_tracks: yes

    terminal:
        start_path: "/mnt/storage/music/" # not needed but makes sense

    inbox:
        concat_nested_folders: yes
        expand_files: no

        folders:
            inbox:
                name: "Rom's inbox"
                path: "/mnt/storage/music/inbox"
                autotag: "preview" # no | "preview" | "import" | "auto"
  1. Edit /mnt/storage/music/config/beets/config.yaml, to include set your library folder:
directory: "/mnt/storage/music/library"
  1. Start the container again.

Now the basics should work, at least your inbox and album folders should show up.

Logs should appear in the terminal, after you start the container.

Hope this helps,
let me know how it goes!

@Rom0067
Copy link
Author

Rom0067 commented Nov 18, 2024

I am absolutely astounded you took this much time to help me! Thank you!! I was able to get it working but I had to make a few changes. What I found:

I am using Pinchflat: https://github.com/kieraneglin/pinchflat to download some of the tracks I don't already own. The folder that pinchflat downloads to was the music folder I mentioned above. I'm not sure why (I am some what new to selfhosting in general) but I am unable to have Beets pull from that folder. I was getting permission errors in the beets logs. So I created a new folder called inbox and manually moved files from music to inbox and then queuing Beets. Beets then tags and moves files. Pinchflat and Beets are both 1000:1000 so Im really at a loss as to why Beets wont pull from the same folder pinchflat uses shrug.

@pSpitzner
Copy link
Owner

Glad I could help!

Some more comments:

  • From the pinchflat docu, it seems like you can set the download folder. With the config from above, that should be /mnt/storage/music/inbox.
  • I would check the permissions and ownership of all three folders (the parent, and our two subfolders) ls -1al
  • I think putting the library as a subfolder of an inbox is a bad idea, as beets would likely recursively try to re-add everything that has already been added.
  • Albums with multiple artists are no problem, just make sure all tracks are within the same folder. (This is much better described in the beets documentation - we are just an inofficial wrapper around the cli)
  • When using the gui, I recommend setting beets to copy instead of moving, as you can easily delete from the inbox by right-clicking any folder (and also select multiple):
    import:
    move: no
    copy: yes
    write: yes
    log: /music/last_beets_imports.log
    quiet_fallback: skip
    detail: yes
    duplicate_action: ask # ask|skip|merge|keep|remove

@Rom0067
Copy link
Author

Rom0067 commented Nov 19, 2024

Thanks again for your replies and all the help! I will look over your comments in more detail and see if they help going forward!

I have a new issues that I cant seem to resolve. I have looked over beets docs and searched all over the web. I was going to create a new issue but since you have been so kind and responsive I figured I would push my luck and post it here. Please let me know if you would like to me to remove this question and create a new help/issue.

The issue I am having is beets is telling me a track is missing and it is not. I have verified that track plays, its metadata is in tack, and attempted to adjust distance_weights (if I understood correctly numbers closer to 1.0 are more lenient) in the config to fix. I even found ignore_case in the official beets docs and added that to my config. No matter what I have tried everytime I try to import this album beets-flash hangs. I even tried imported in the cli of the gui. Im attaching a few screenshots to show the problem a little better. Thanks in advance!

beets-flast interactive import:
Screenshot 2024-11-19 162038

my config:

match:
    # autotagger tolerance [0, 1], default 0.04
    # for example, 0.1 means 90% similarity required.
    # inbox-folder autotag setting 'auto' respects this and imports above the threshold (like the beets cli would)
    strong_rec_thresh: 0.1
    ignore_case: yes

    # customize how penalties affect the match score
    distance_weights:
        # source: 2.0
        #artist: 3.0
        #album: 3.0
        # media: 1.0
        # mediums: 1.0
        # year: 1.0
        # country: 0.5
        # label: 0.5
        # catalognum: 0.5
        # albumdisambig: 0.5
        # album_id: 5.0
        #tracks: 2.0
        missing_tracks: 0.9 # If your prefer not being so picky about missing tracks. default 0.9
        # unmatched_tracks: 0.6
        # track_title: 3.0
        # track_artist: 2.0

If necessary I can provide the missing tracks metadata but its pretty lengthy as far as I can tell. Please let me know if there is anything else I could provide to help trouble shoot this issue. Thanks again

@pSpitzner
Copy link
Owner

pSpitzner commented Nov 21, 2024

hmm,

this is something i would debug with beets cli, as you started already. this way, you can rule out that it's our gui messing things up.

if the track plays fine, and metadata indeed is correct, the last two things i could imagine are the file extension being not recognized or permission not allowing beets to read the file.

a few beets import options that might help:

  • --pretend
  • -t (timid)
  • -v and -vv for verbose logging

https://beets.readthedocs.io/en/stable/reference/cli.html#import

note that the distance weights (or any other config setting i can think of) shouldn't cause this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants