#4 Patch to track when a song was last played in the pk3 db

open
nobody
None
5
2014-08-17
2010-11-16
Brian Millham
No

This patch (based on 0.8.4) will add 2 new fields to the prokyon3 database, and track when a song was last played, and how many times.

The song will only be marked as played if streaming is active.

Also included is a crude python script that will parse the history.log file, and import the play data into the database.

You will have to run IDJC and connect to the P3 database before running the above mentioned script so that the required fields are created in the database.

The patch is crude, and needs some touchup work from someone who is better with python than I am.

Played songs will be displayed in the P3 view and marked with a **, and also show the date last played. (I wanted highlight instead, but couldn't figure out how.)

Discussion

  • Brian Millham
    Brian Millham
    2010-11-16

    Patch to track when a song was last played

     
    Attachments
  • Brian Millham
    Brian Millham
    2010-11-16

    There is one line that will need correcting in this patch. Change the following line:

    c.execute(c, """ALTER TABLE tracks ADD play_count INT NOT NULL DEFAULT '0'""")

    to

    c.execute("""ALTER TABLE tracks ADD play_count INT NOT NULL DEFAULT '0'""")