Serato Play Counts Migration Tool

(UPDATE 1/5/2020: it is no longer necessary to delete the serato DB file for this tool to work)

Serato DJ Pro 2.2 introduces a  new play count column that tracks the number of times a song was played.  This feature has been requested forever and it's great to see it finally added to the software.

Unfortunately though, the feature ignores all play counts prior to the update.

To help bridge the gap, I've open sourced a command line tool that will:
  1. scan serato historical session files to tabulate the number of times each track was played
  2. attempt to locate all session mp3s.
  3. Overwrite the id3 field serato uses to store play counts ('TXXX:SERATO_PLAYCOUNT') with the tabulated value.

Disclaimer:
I've only tested this tool on OSX Mojave against my own library and Serato DJ Pro 2.2.0. While my experience has been positive yours may not.

No warranties are given or implied. use at your own risk!

Please backup your library and serato files if you do plan on using it.  overwriting ID3 tags is a destructive edit and may cause some or possibly all mp3 files to become corrupt.

source code + instructions can be found here:
https://gitlab.com/eladmaz/serato-play-counter/tree/master

Cheers!

Comments

  1. nice one, was wondering if you were going to do this. Unfortunately I got some errors similar to:

    Oct. 09, 2019 2:17:22 PM org.jaudiotagger.tag.id3.framebody.AbstractID3v2FrameBody read
    WARNING: Problem reading datatype within Frame Body:Unable to find null terminated string
    Oct. 09, 2019 2:17:22 PM org.jaudiotagger.tag.id3.AbstractID3v2Frame readBody
    SEVERE: 02 Rhythm & Soul (Tiger Stripes Remix).mp3:An error occurred within abstractID3v2FrameBody for identifier:UFID:Unable to find null terminated string
    Oct. 09, 2019 2:17:22 PM org.jaudiotagger.tag.id3.ID3v24Tag readFrames
    WARNING: 02 Rhythm & Soul (Tiger Stripes Remix).mp3:Corrupt Frame:Unable to find null terminated string
    [14:17:22]ERROR Id3TagPlayCountWriteService: encountered error while attempting to set play counts for [/Users/ahatfield/Music/iTunes/M.A.N.D.Y_/Voltaire Music pres. V/02 Rhythm & Soul (Tiger Stripes Remix).mp3]
    java.lang.NoSuchMethodError: sun.nio.ch.DirectBuffer.cleaner()Lsun/misc/Cleaner;
    at org.jaudiotagger.audio.mp3.MP3File.readV2Tag(MP3File.java:252)
    at org.jaudiotagger.audio.mp3.MP3File.(MP3File.java:466)
    at org.jaudiotagger.audio.mp3.MP3FileReader.read(MP3FileReader.java:39)
    at org.jaudiotagger.audio.AudioFileIO.readFile(AudioFileIO.java:288)
    at org.jaudiotagger.audio.AudioFileIO.read(AudioFileIO.java:151)
    at org.ssldev.playcounter.services.Id3TagPlayCountWriteService.setPlayCount(Id3TagPlayCountWriteService.java:84)
    at java.base/java.util.HashMap.forEach(HashMap.java:1333)
    at java.base/java.util.Collections$UnmodifiableMap.forEach(Collections.java:1503)
    at org.ssldev.playcounter.services.Id3TagPlayCountWriteService.writePlayCountTags(Id3TagPlayCountWriteService.java:64)
    at org.ssldev.core.mgmt.EventHub.lambda$add$2(EventHub.java:106)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1540)
    at org.ssldev.core.mgmt.EventHub.add(EventHub.java:106)
    at org.ssldev.core.mgmt.AsyncEventHub.lambda$new$0(AsyncEventHub.java:27)
    at org.ssldev.core.mgmt.AsyncEventHub$1.run(AsyncEventHub.java:45)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:835)

    ReplyDelete
    Replies
    1. what version of java are you using?

      Looks like jaudiotagger (the lib i use for tagging files) has a dependency on a sun class which may have been removed at some point.

      Delete
    2. i've updated the project to use the latest version of jaudiotagger which should fix this. Try deleting & re-downloading the SeratoPlayCounter jar, and running the tool again.

      let me know if this works for you!

      Delete
    3. Awesome, that worked a treat, thank you. Love having all the playcounts in there now

      Delete
  2. One thing I noticed is that when it runs it overwrites the added field. So all tracks that have had a playcount updated has had the date added reset.

    Not the end of the world but worth noting.

    ReplyDelete
    Replies
    1. are you referring to the 'date added' column in serato? i believe it's controlled by the database v2 file, which resets the added date when it gets re-created. Curious that not all your tracks dates were reset.

      There may be a way to set counts without deleting the file. I'll have to look into decoding the db file at some point.

      Delete
    2. This comment has been removed by the author.

      Delete
    3. Managed to fix it by removing the iTunes Music Library.xml and recreating it

      No idea why it happened. For some reason the date added field in Serato for some files was different to that in itunes

      Delete

Post a Comment

Popular posts from this blog

New and Improved Serato Crate Exporter (with m3u support)

Serato STATS screen shots

Serato Crate Exporter