nicfit / eyeD3

eyeD3 is a Python module and command line program for processing ID3 tags. Information about mp3 files (i.e bit rate, sample frequency, play time, etc.) is also provided. The formats supported are ID3v1 (1.0/1.1) and ID3v2 (2.3/2.4).
http://eyed3.nicfit.net/
GNU General Public License v3.0
532 stars 58 forks source link

json and yaml output missing track number #527

Closed mpalermo73 closed 3 years ago

mpalermo73 commented 3 years ago

Hey!

I was going to move a few scripts of mine over to using eyeD3 -P json and jq instead of doing a lot of uglyu greping, but I've noticed the the json and ytml output do not include the track number of the file.

You see that the standard eyeD3 output includes the "track: 1/4" part, but plugin output does not.

-> % eyeD3 --version
0.9.5

Standard eyeD3 output

-> % eyeD3 01\ -\ Kazakhstan.mp3
/usr/local/music/Brian Eno/2018 - Music for Installations/01 - Kazakhstan.mp3                                           [ 35.06 MB ]
-------------------------------------------------------------------------------------------------------------------------------------
Time: 20:19 MPEG1, Layer III    [ ~240 kb/s @ 44100 Hz - Joint stereo ]
-------------------------------------------------------------------------------------------------------------------------------------
ID3 v2.3:
title: Kazakhstan
artist: Brian Eno
album: Music for Installations
album artist: Brian Eno
release date: 2018
original release date: 2018
recording date: 2018
track: 1/4      genre: Electronic (id 52)
Publisher/label: Opal Records/Universal Music (UK) Ltd.
Unique File ID: [b'http://musicbrainz.org'] : 62d79f6c-d624-46b5-b772-4d795a2db270
UserTextFrame: [Description: ASIN]
B07BF854N4
UserTextFrame: [Description: originalyear]
2018
UserTextFrame: [Description: CATALOGNUMBER]
671 777-2
UserTextFrame: [Description: MusicBrainz Album Release Country]
XE
UserTextFrame: [Description: Acoustid Id]
ed6454fc-6461-4350-baf3-596812bf0247
UserTextFrame: [Description: MusicBrainz Artist Id]
ff95eb47-41c4-4f7f-a104-cdc30f02e872
UserTextFrame: [Description: MusicBrainz Release Group Id]
68fbc538-94d2-427a-a9d9-81f437bd80dd
UserTextFrame: [Description: Subtitle (converted)]
Music From Installations
FRONT_COVER Image: [Size: 147229 bytes] [Type: image/jpeg]
Description: 2018 - Music for Installations

json output

{
  "path": "/usr/local/music/Brian Eno/2018 - Music for Installations/01 - Kazakhstan.mp3",
  "info": {
    "time_secs": 1219.13,
    "size_bytes": 36763979
  },
  "album": "Music for Installations",
  "album_artist": "Brian Eno",
  "artist": "Brian Eno",
  "best_release_date": "2018",
  "genre": "Electronic",
  "non_std_genre": "Electronic",
  "original_release_date": "2018",
  "publisher": "Opal Records/Universal Music (UK) Ltd.",
  "recording_date": "2018",
  "release_date": "2018",
  "title": "Kazakhstan",
  "_eyeD3": "0.9.5"
}

yaml output

---
_eyeD3: 0.9.5
album: Music for Installations
album_artist: Brian Eno
artist: Brian Eno
best_release_date: '2018'
genre: Electronic
info:
  size_bytes: 36763979
  time_secs: 1219.13
non_std_genre: Electronic
original_release_date: '2018'
path: /usr/local/music/Brian Eno/2018 - Music for Installations/01 - Kazakhstan.mp3
publisher: Opal Records/Universal Music (UK) Ltd.
recording_date: '2018'
release_date: '2018'
title: Kazakhstan

THANK YOU! M.

nicfit commented 3 years ago

Right you are @mpalermo73 . JSON/YAML are two of the newest plugins and there is plenty left to do, and track numbers is one (and likely next due to its importance): https://github.com/nicfit/eyeD3/blob/0.9.x/eyed3/plugins/jsontag.py#L67

Glad to know the plugin is being used.

matt-palermo-olo commented 3 years ago

Ooooooo :burns_excellent:

Thank you for the update! This is great news to hear.

nicfit commented 3 years ago

Track and disc numbers now serialized: https://github.com/nicfit/eyeD3/commit/3b4b839d2a6453f3e2f67b1d46d95d95ffe1154e