StratusFearMe21 / listenbrainz-mpv

Scrobbles Music files properly using MPV
GNU General Public License v3.0
3 stars 0 forks source link

Error submitting feedback #2

Closed otrocodigo closed 1 year ago

otrocodigo commented 1 year ago

Add the key bindings as indicated in the README:

# $HOME/.config/mpv/input.conf
Ctrl+UP script-binding listenbrainz-love
Ctrl+DOWN script-binding listenbrainz-hate
Shift+Ctrl+DOWN script-binding listenbrainz-unrate

An error occurs when I press Ctrl+UP:

This song is unknown to ListenBrainz or has IDv3 tags, and cannot be rated
Error submitting feedback: Err(Status(400, Response[status: 400, status_text: BAD REQUEST, url: https://api.listenbrainz.org/1/feedback/recording-feedback]))

Audio track tags (via mediainfo):

...
Album                                    : Everlasting Ascendancy
Album/Performer                          : Malice Divine
Album/Performer/Sort                     : Malice Divine
Part/Position                            : 1
Part/Total                               : 1
Track name                               : Reclaimed Strength
Track name/Position                      : 6
Track name/Total                         : 8
Performer                                : Malice Divine
Performer/Sorted by                      : Malice Divine
Original/Released date                   : 2023
Recorded date                            : 2023-01-27
Writing library                          : LAME3.99r
Cover                                    : Yes
Cover type                               : Cover (front)
Cover MIME                               : image/jpeg
SCRIPT                                   : Latn
Media Type                               : Digital Media
ASIN                                     : B0BMKR7Q7K
originalyear                             : 2023
ARTISTS                                  : Malice Divine
MusicBrainz Album Type                   : album
MusicBrainz Album Status                 : official
MusicBrainz Album Release Country        : XW
MusicBrainz Album Id                     : 41ee8ac2-e943-429f-af49-fdc389e09203
MusicBrainz Artist Id                    : 5485327f-dbe5-4652-a65f-d2359a3a13f2
MusicBrainz Album Artist Id              : 5485327f-dbe5-4652-a65f-d2359a3a13f2
MusicBrainz Release Group Id             : da5312e2-eb7c-477a-ab89-06355f2d9fec
MusicBrainz Release Track Id             : 5345ea7e-b5bb-4e04-b5dc-2ad47f088a5d
...
StratusFearMe21 commented 1 year ago

Indeed, if the song you're playing is an MP3, MPV won't expose the Musicbrainz recording ID to the plugin, and thus it's not possible to rate them on Listenbrainz. This is because MusicBrainz maps recording IDs really weirdly on MP3 files in a way MPV doesn't read. I'll definitely try to figure out a solution though

StratusFearMe21 commented 1 year ago

Looks like your mediainfo program couldn't read the recording ID either.

StratusFearMe21 commented 1 year ago

Instead of something reasonable, Picard seems to map the Recording ID to the tag: UFID:http://musicbrainz.org.

otrocodigo commented 1 year ago

It seems to be a 'Picard' problem with MP3 files, it doesn't write all the tags correctly.

I tried with M4A and if the "MusicBrainz Track Id" is listed, it still gives me the same problem:

This song is unknown to ListenBrainz or has IDv3 tags, and ...

M4A File info (via mediainfo)

...
Format                                   : MPEG-4
Format profile                           : Apple audio with iTunes info
Codec ID                                 : M4A  (M4A /isom/iso2)
...
Album                                    : In Your Hands
Album/Performer                          : Interra
Album/Performer/Sort                     : Interra
Part/Position                            : 1
Part/Total                               : 1
Track name                               : Distance
Track name/Position                      : 2
Track name/Total                         : 8
Performer                                : Interra
Performer/Sorted by                      : Interra
Recorded date                            : 2022-12-16
Writing application                      : Lavf59.27.100
...
MusicBrainz Album Release Country        : XW
MusicBrainz Album Type                   : album
MusicBrainz Album Status                 : official
MusicBrainz Release Track Id             : 00fb1585-c729-44d7-92ea-76345563d4e7
MusicBrainz Album Id                     : a2424e5a-9703-4439-ad2e-16bc826c91e6
MusicBrainz Release Group Id             : aceddbbd-e3e9-4431-aef0-26ba77ca5640
MusicBrainz Track Id                     : ecb0200a-fa52-4534-8357-fcecd8e27a78
MusicBrainz Album Artist Id              : f9bfdd12-0bd4-495d-ae33-8ca5f0fabc7d
MusicBrainz Artist Id                    : f9bfdd12-0bd4-495d-ae33-8ca5f0fabc7d
originalyear                             : 2022
SCRIPT                                   : Latn
ARTISTS                                  : Interra
originaldate                             : 2022-12-16
MEDIA                                    : Digital Media
StratusFearMe21 commented 1 year ago

The track id and the recording id are not the same. Not entirely sure what the difference is, but Listenbrainz wont take the track id

otrocodigo commented 1 year ago

According to the 'Listenbrainz' documentation, you can pass the 'recording_mbid' or 'recording_msid' or both: https://listenbrainz.readthedocs.io/en/latest/users/feedback-json.html#feedback-json-doc

recording_mbid = MusicBrainz Track Id

Another way to get the MBID is by GET /1/metadata/lookup/ https://listenbrainz.readthedocs.io/en/latest/users/api/metadata.html?highlight=lookup#get--1-metadata-lookup-

Response sample:

{
    "artist_credit_name": "Interra",
    "artist_mbids": [
        "f9bfdd12-0bd4-495d-ae33-8ca5f0fabc7d"
    ],
    "recording_mbid": "ecb0200a-fa52-4534-8357-fcecd8e27a78",
    "recording_name": "Distance",
    "release_mbid": "a2424e5a-9703-4439-ad2e-16bc826c91e6",
    "release_name": "In Your Hands"
}
StratusFearMe21 commented 1 year ago

This issue should be fixed now with the latest commit. (One other change I made is that if you were using connman, you need to add --features connman to your compile command, otherwise, just use the same command you were using before)

otrocodigo commented 1 year ago

Great. Thank you very much for the project.