MediaBrowser / Emby

Emby Server is a personal media server with apps on just about every device.
https://emby.media
GNU General Public License v2.0
4.11k stars 803 forks source link

[Bug] Metadata reset when adding lyrics #3798

Open Ed1ks opened 10 months ago

Ed1ks commented 10 months ago

Hello, If I set metadata for audiobooks, and upload a .lrc in same directory, the metadata get lost and reseted.

LukePulverenti commented 10 months ago

Hi, can you please provide a specific example? Thanks.

Ed1ks commented 10 months ago
  1. Put an mp3 with no metadata in directory.
  2. Emby sees it and adds it to library.
  3. Change Metadata with Emby of this Songfile.
  4. Put an .lrc file with same name as song/audiobook in the same directory
  5. Emby combines both
  6. Emby looses the metadata. I have to repeat step 3
LukePulverenti commented 10 months ago

HI, loses what metadata exactly?

Ed1ks commented 10 months ago

HI, loses what metadata exactly?

If I select in Emby the audio file and choose edit Metadata in context menu, the metadata has been reseted.

LukePulverenti commented 10 months ago

Hi, like what metadata?

Ed1ks commented 10 months ago

Title, Year, date, album, author, album author

Ed1ks commented 10 months ago

Title, year, date, album, author, album author

Everything gets removed. Probably emby performs an Metadata scan and because I have disabled online scrappers, it scan the file itself and resets the metadata which I have set in emby.

LukePulverenti commented 10 months ago

Because it rereads the information embedded in the audio file. What did you think refresh metadata was going to do?

Ed1ks commented 10 months ago

I thougth it does

  1. nothing because I have disabled all online scrappers. And
    1. It doesnt perform metadata rescan just because I added a lyrics file. It destroys the purpose of edit medata function in emby, if its data get reseted.
Ed1ks commented 10 months ago

@LukePulverenti

Because it rereads the information embedded in the audio file. What did you think refresh metadata was going to do?

Are there any plans for bugfixing this soon? I have a bigger library with lots of recorded audio. I dont want to loose suddenly all metadata.

Edit: I just saw, that my Emby doesnt create any .nfo files. Checkmark in Library Settings is set. I am using Docker with Emby.

Edit2: Investigating further I checked the logs after saving metadata in Emby. It sends a POST Request and gets Response 204. Seem ok, I guess? The Metadata is saved, but no NFO created. Permission are also ok (same User & Group as emby) Im Using Audiobooks and a flat structure: Media/ Audiofile1.mp3 Audiofile1.lrc Audiofile2.mp3 Audiofile2.lrc ...

Like mentioned, the checkmark for using NFO is set in the settings of the library.

LukePulverenti commented 10 months ago

There is no nfo for audio files. If you edit fields in the metadata editor, then they'll get locked. When you refresh metadata you won't lose any data from locked fields, so I don't think there's any bug that needs fixing.

Ed1ks commented 10 months ago

Thats what I mean: the metadata gets lost, when refreshing. Ok, I didnt know that there are no nfo files for audio files. The avaliable checkmark in the audiobook library settings is misleading then.

There is no Lock for date, author, album or year

Is it possible to integrate, that emby writes metadata directly into the audio file?

LukePulverenti commented 9 months ago

HI, yes this has come up before and is possible for future updates. Thanks.

Ed1ks commented 9 months ago

HI, yes this has come up before and is possible for future updates. Thanks.

I would appreciate it a lot, if it will be integrated soon 🙂

Ed1ks commented 9 months ago

@LukePulverenti The feature of editing and refresh metadata in Emby is bugged. If refreshing, it loads the title, album, albumartist, artist from file. But Date, Year and Genre not. Date, Year and Genre cant be changed by changing tags in file.

I am about to script an fix for myself which just loads the tags every hour from embys library.db into the files. But im hanging on the fact, that emby is not loading all tags on refresh from files. I cleaned genre from file and set 'date' tag. but it always rollsback to the data it had first. So after sitting hours on my script, I have to give up, because its only fixable by emby itself.

File Tags: image

But Emby loads after refreshing: image

Even though Emby loads Title, Album and Interpreter correctly from file.

I want to use Emby for an group of people which can listen shared recorded audio files which are not found on any scrapper online. We need a stable metadata managment system, as we need to fill all data by hand. The risk of everything gets removed by an emby feature is not acceptable.

But else emby is perfect for our use case and we just bought an premium lifetime key because we tought everything works flawlessly.

It is super important for us, that we dont loose our metadata. I beg you to set an priority on this for fixing this for example by adding an "write metadata to file" checkbox in settings.

LukePulverenti commented 9 months ago

The point of refresh metadata is to refresh from sources. Everything gets replaced unless you've locked the fields in the metadata editor.

Ed1ks commented 9 months ago

See on my 2nd screenshot the lock is open. There is no genre in the .mp3 anymore but doesnt load from source on refresh.

LukePulverenti commented 9 months ago

Please attach the emby server log. Thanks.

Ed1ks commented 9 months ago

embyserver.txt

In Line 383 I started refreshing the metadata of that audio file.

Ed1ks commented 9 months ago

@LukePulverenti Im sorry to trigger you again. Did you had time to check it out?

I need to have the metadata in files because I dont know when Emby is running the refresh metadata event from itself. Adding the lyrics file to it is one event which triggers the data to refresh (and delete itself). I have 200+ Audio Files which metadata will be maintained trough embys metadata editor. A loss of those datas would be mess. I hope you understand the risk which exists here.