I am failing to import "tracknumber" (id3=TRCK)
  • I am importing audio metadata into airtime, via my MP3 library, under "watch" directories. The flow is as such.

    • /srv/airtime/watch created on airtime server filesystem, and configured in settings.
    • scp recordings to this directory..
    • watch airtime pick up the new data. works well.

    The exception, being the MDATA_KEY_TRACKNUMBER metadata value (aka tracknumber or TRCK). The following is an example of one of the sample mp3 files and what is written into the database.

    For reference, i poked at the airtimemetadata.py module, specifically the AirtimeMetadata object. My file returns legit tags.

    In [1]: from airtimemetadata import AirtimeMetadata
    In [2]: md = AirtimeMetadata()
    In [3]: b = md.get_md_from_file('/tmp/1.mp3')

    In [4]: b
    Out[4]:
    {'MDATA_KEY_BITRATE': 238589,
     'MDATA_KEY_COMPOSER': u'Broken Bells',
     'MDATA_KEY_CREATOR': u'Broken Bells',
     'MDATA_KEY_DURATION': '0:3:45.384489',
     'MDATA_KEY_ENCODER': u'myself',
     'MDATA_KEY_FTYPE': 'audioclip',
     'MDATA_KEY_GENRE': u'Alternative Rock',
     'MDATA_KEY_LABEL': u'Columbia',
     'MDATA_KEY_MD5': '1bb921b6b97470c840183d084db633e5',
     'MDATA_KEY_MIME': 'audio/mp3',
     'MDATA_KEY_REPLAYGAIN': '-7.400000',
     'MDATA_KEY_SAMPLERATE': 44100,
     'MDATA_KEY_SOURCE': u'Broken Bells',
     'MDATA_KEY_TITLE': u'The High Road',
     'MDATA_KEY_TRACKNUMBER': 1,
     'MDATA_KEY_YEAR': u'2010'}

    Yet, when it is tossed into postgres, the track_number is missing for this file :s


    airtime=> SELECT id, track_title, artist_name, album_title, genre, year, track_number
      FROM cc_files
     WHERE artist_name = 'Broken Bells'
       AND track_title LIKE 'The High Road%';
    -[ RECORD 1 ]+-----------------
    id           | 276
    track_title  | The High Road
    artist_name  | Broken Bells
    album_title  | Broken Bells
    genre        | Alternative Rock
    year         | 2010
    track_number |

    for reference the file in question sits at http://jesseward.com/1.mp3


  • 2 Comments sorted by
  • Hi Jesse,

    Thanks for the detail in your post. This is a known issue with the Airtime media importer  - https://dev.sourcefabric.org/browse/CC-5680 - a quick (and very dirty) workaround would be to strip the "/10" component from the 'track' ID3 tag.

    You can add your voice to the issue by voting for it via that URL above. The Airtime dev team use this information to inform their task priorities, so it can't hurt to vote :)
  • thanks this helps. I have revised my id3 tagging script to supply the tracknumber only (leaving out track total). Forced a rescan of the watched directories and confirmed the track numbers are present.

    I am unable to view the linked bug in that ticket (http://dev.sourcefabric.org/browse/SAAS-376), so not sure what information is available.

    for reference here is the POST data sent by media-manger to the airtime API

    POST /api/reload-metadata-group/format/json/api_key/XX HTTP/1.1
    Accept-Encoding: identity
    Content-Length: 975
    Host: analogbubblebath.xx.xx:80
    Content-Type: application/x-www-form-urlencoded
    Connection: close
    User-Agent: Python-urllib/2.7
    md0=%7B%22MDATA_KEY_MD5%22%3A+%2247d458327f3bbfcddc036afdb1dc9cc1%22%2C+%22MDATA_KEY_GENRE%22%3A+%22Alternative+Rock%22%2C+%22MDATA_KEY_TITLE%22%3A+%22The+High+Road%22%2C+%22MDATA_KEY_ENCODER%22%3A+%22myself%22%2C+%22MDATA_KEY_CREATOR%22%3A+%22Broken+Bells%22%2C+%22MDATA_KEY_CUE_IN%22%3A+%220.0%22%2C+%22MDATA_KEY_SOURCE%22%3A+%22Broken+Bells%22%2C+%22MDATA_KEY_YEAR%22%3A+%222010%22%2C+%22MDATA_KEY_MIME%22%3A+%22audio%2Fmp3%22%2C+%22MDATA_KEY_FILEPATH%22%3A+%22%2Fsrv%2Fairtime%2Fwatch%2Fbootlegs%2F1.mp3%22%2C+%22MDATA_KEY_DURATION%22%3A+%220%3A3%3A45.384490%22%2C+%22MDATA_KEY_BITRATE%22%3A+%22238589%22%2C+%22MDATA_KEY_SAMPLERATE%22%3A+%2244100%22%2C+%22mode%22%3A+%22create%22%2C+%22MDATA_KEY_FTYPE%22%3A+%22audioclip%22%2C+%22MDATA_KEY_TRACKNUMBER%22%3A+%22%22%2C+%22MDATA_KEY_ORIGINAL_PATH%22%3A+%22%2Fsrv%2Fairtime%2Fwatch%2Fbootlegs%2F1.mp3%22%2C+%22MDATA_KEY_CUE_OUT%22%3A+%220.0%22%2C+%22MDATA_KEY_COMPOSER%22%3A+%22Broken+Bells%22%2C+%22is_record%22%3A+false%7D