mgoltzsche / beets-autogenre

beets plugin to auto-detect the genre for each item within your music library
Apache License 2.0
6 stars 0 forks source link

Hi #1

Open JOJ0 opened 2 months ago

JOJ0 commented 2 months ago

How could you hide that plugin from me for more than 3 months?? ;-))) The descriptions sound awesome and exactly what I'm looking for. I'll read some code and play around with it and maybe add some more details to the docs once I find out what it does! It sounds superpowerful! Thanks again and sorry for the spam issue! Only problem is I'm travelling currently with limited computing resources 😁

mgoltzsche commented 2 months ago

Great that you find it useful too! FYI: Unfortunately, for genre detection xtractor/essentia turned out not to be very useful to me: After I tweaked my lastgenre plugin config a bit, I got better results: In case of my library only 8/3k songs didn't have a lastgenre-assigned genre. Unfortunately xtractor/essentia doesn't help in this case since it returns the dance genre for these 8 songs :disappointed:. The dance genre seems to be where songs of various genres end up when it couldn't detect the genre. Therefore, I am thinking about treating the dance genre as not found/empty string. For other songs the public essentia models mostly detected the correct genre but they are less granular than last.fm tags so that it would not be a good replacement for the last.fm integration. Also, I started working on supporting an auto config option just like the lastgenre plugin has.

JOJ0 commented 2 months ago

Interesting! Thanks for sharing your usecases and what works for you. I have quite some tracks that are not to found via lastgenre. No access to my library currently, but the music I have on my mobile via Navidrome-offline tells me already that there is quite some (I have a fallback genre configured named NoLastGenre): image

What I sometimes do is run whatlastgenre over those albums, which fixes at least some of them. The problem with the latter plugin though is that it's only album-based and not track-based as I prefer to tag my genres.

I'd love to tinker with Essentia genre-rosamerica now to see if those NoLastGenre tracks would get anything more zseful than "dance" for my lib! But too bad no lib for the next couple months ;-)

Very interesting topic in general: getting genres in a lib right. Do you mind if we keep this issue open as a general "sharing usecases and findings chitchat" thread?

mgoltzsche commented 2 months ago

I forgot to mention that the lastgenre plugin didn't find the genre for ~300 songs in my library (and found the wrong one for a few). However, it turned out that in my library most of those songs were remixes/sets/collections and the genre was part of the song or album title (the ytimport plugin splits mixes/long tracks with chapter metadata and imports them as albums). That's why I made the autogenre plugin derive the genre from the title: grafik

Btw the newer songs within my library with an essentia-based genre have a more meaningful genre assigned (not dance) but unfortunately not as granular as the title and lastfm based genres within my library: grafik

Do you mind if we keep this issue open as a general "sharing usecases and findings chitchat" thread?

Sure, we can do that.

mgoltzsche commented 4 weeks ago

It would be great if you could shed some light on the odd Beets behaviour I discovered while trying to make the autogenre plugin run on import automatically within #2.

Also, I wonder what makes you favour Navidrome-offline over other mobile players? I didn't try using Navidrome yet.

TL;DR: In case you're curious about my actual Beets use-cases, here they are:

Before I used Beets, I used Mopidy with the Mopidy-YouTube plugin to listen to music - I can still highly recommend it since its auto-play feature finds related, potentially new music which is a feature that is still missing in my Beets setup. When I went to an off-grid vacation last year I wanted to bring some music with me for which I wrote a primitive shell script spontaneously to copy my Mopidy-Youtube cache from the Raspberry Pi, generate a playlist from it and copy it to the phone. Obviously the playlist wasn't great because it was a mix of everything - but better than nothing. When I came back from vacation I came across Beets and started playing with it.

JOJ0 commented 4 weeks ago

I wonder what makes you favour Navidrome-offline over other mobile players? I didn't try using Navidrome yet.

Other mobile players? Not sure if I understand entirely correct? Or did you want to say "other media servers instead of navidrome?"

Or is the question why I dont simply copy over mp3 files to my mobile without any server?

mgoltzsche commented 4 weeks ago

music I have on my mobile via Navidrome-offline

It sounded like you are using a Navidrome app on your mobile phone to play music but I may have misunderstood that since I don't find a Navidrome mobile app. Though, then I wonder how are you playing the music on your mobile phone offline while you're travelling when you don't just copy the files over? Which kind of app is it you made a screenshot of? Is it a Subsonic client with an offline mode? You don't bring a Raspberry Pi with you while you're travelling and you are not running the Navidrome server on your phone, are you :smiley:? My copy-all-files-approach may not scale well with my growing music library and I already encountered problems with the MTP file synchronization implementation on Ubuntu. In case you already tried multiple of these apps and offline music playing workflows and think that Navidrome and this app works best for you, I'd be curious to hear about that. Otherwise don't bother writing a roman about it :wink:.

My other question is actually more important: why is Beets failing to write to custom fields during import but succeeding to writes those fields when the same code is run via a separate command (beet autogenre)?

JOJ0 commented 4 weeks ago

music I have on my mobile via Navidrome-offline

It sounded like you are using a Navidrome app on your mobile phone to play music but I may have misunderstood that since I don't find a Navidrome mobile app. Though, then I wonder how are you playing the music on your mobile phone offline while you're travelling when you don't just copy the files over? Which kind of app is it you made a screenshot of? Is it a Subsonic client with an offline mode? You don't bring a Raspberry Pi with you while you're travelling and you are not running the Navidrome server on your phone, are you :smiley:?

My copy-all-files-approach may not scale well with my growing music library and I already encountered problems with the MTP file synchronization implementation on Ubuntu.

In case you already tried multiple of these apps and offline music playing workflows and think that Navidrome and this app works best for you, I'd be curious to hear about that. Otherwise don't bother writing a roman about it :wink:.

No worries, just wanted to clarify what you are interested in. 🙂

Yeah that was sloppy wording. I currently use play:sub subsonic client on an iphone. I'm not always happy with that app because of tiny issues and the dev is not responding at all to my suggestions, questions, friendly messages. It's a paid app. Still, it's one of the best subsonic apps on mobile.

I want to switch to Amperfy app. FOSS and dev responsive, just some features missing I'm waiting for to suit my needs.

navidrome is the server because I want to run it directly on my dated 2010 Synology NAS. It's quite minimalist and so far the only server that performs well on that hardware. Dev is responsive and creates wuality code it seems.

copying over files to a filesystem that is accessible from apps is not a thing on iphones. Also 128GB storage is not enough for my library;-)

I simply wanted a flexible solution to make albums and beets dmartplaylists available on my phone, similar to streaming spps like spotify. one button press should make things offline or not. server transcodes my flacs to 320 mp3 to save space on phone. my server is not yet on the internet. maybe I'll find the time to securely implement that one day. it's probably only a docker https relay away ;-)

JOJ0 commented 4 weeks ago

My other question is actually more important: why is Beets failing to write to custom fields during import but succeeding to writes those fields when the same code is run via a separate command (beet autogenre)?

I don't have an answer sorry, only some probably useless ideas on how to investigate...

Is genres a db field? Or a flexible attribute?

Is genres a proper nullchar delimited field as implemented in #fixme

Or was it there before that in beets? Without any magic it would be a simple flexible attribute. in theory

The error points to beets trying to access it via an actual sql statement, which is just wrong. somewhere higher in the code it should realize that this is not a fixed db field and only a flex attr.

maybe you look up where that magic happens snd what could be the difference when it's run during import

not much help I'm sorry...

mgoltzsche commented 3 weeks ago

Thanks for letting me know about your setup! I am an Android user so that I cannot use the Amperfy app unfortunately but the sync mechanism you describe sounds like what would scale with a larger library, indeed, and what I could also use. I didn't expose my music library via HTTP within the internet (yet). I worked on the Beets HTTP support in order to decouple it from Mopidy so that both apps/docker containers could be installed separately which works best via network in the kubernetes/microservice/container world, even though in practice both may run on the same machine. That said, I am a bit surprised that Beets' Subsonic server plugin (Beetstream) isn't more popular.

I answered your questions related to the attribute error on import within the PR now.