Skip to content

Statistics table not initialised #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jrha opened this issue Aug 3, 2013 · 0 comments
Open

Statistics table not initialised #1

jrha opened this issue Aug 3, 2013 · 0 comments
Assignees
Labels
Milestone

Comments

@jrha
Copy link
Owner

jrha commented Aug 3, 2013

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
@ghost ghost assigned jrha Aug 3, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant