Skip to content

Statistics table not initialised #1

@jrha

Description

@jrha

If a new instance of ssp is deployed, the player will throw an exception after completion of the first track (either skipped or played) along the lines of:

Traceback (most recent call last):
  File "./player.py", line 118, in key_press
    self.skip()
  File "./player.py", line 176, in skip
    self.stat.skipcount += 1
AttributeError: 'NoneType' object has no attribute 'skipcount'

This is caused by the assumption that the statistics table already contains entries for each hour of the day, which it won't.
I'm not yet sure where the best place to initialise the table is, for now a workaround on linux is:

for i in {0..23}; do
    echo "insert into stats values($i, 0, 0);"
done | sqlite3 library-v2.db

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions