mpdcron
mpdcron copied to clipboard
stats module queries
The stats module is the most interesting part of mpdcron for me, however, I'm having trouble configuring it.
I have the following dependencies installed:
sqlite3 v3.6.23.1
ruby 1.9.1p378
nokogiri 1.4.1
I'm running ArchLinux and can't find a package for gio
. Perhaps gvfs?
My config file is just as standard.
mpdcron
launches fine, similarly for walrus
to update. I'm not so sure about eugene
however. I get errors if I run something like:
$ eugene list radiohead
Failed to list song: EOF while trying to read a line
$ eugene listtags
Failed to list tags of current playing song: you don't have permission for "listtags"
Also, with homescrape
I get:
$ homescrape
/usr/bin/homescrape:106:in `<main>': undefined method `parse' for Date:Class (NoMethodError)
Sorry for the naïvety of this post.
Sorry for the late response.
Let's go one by one.
First remove the line
passwords= needvodka@update;needbeer@select
from your configuration file and tell me if it fixes the problems related to eugene.
I don't have ruby-1.9 installed right now, I'll install it and check out if I can reproduce your problem about homescrape.
Removing the passwords line fixes the issue with eugene
(I think!):
$ eugene addtag test
Modified 1 entries
$ eugene listtags
96: Tags:test vangelis/13-blade-runner-blues.mp3
$ eugene listinfo
96: Play_Count:0 Love:1 Kill:1 Rating:0 vangelis/13-blade-runner-blues.mp3
Though I'm not sure of the syntax: what is meant by "song/artist/album/genre"?
$ eugene list artist
$ eugene list artist vangelis
$ eugene list
No expression given
$ eugene list *
Failed to list song: EOF while trying to read a line
$ eugene list vangelis
Failed to list song: sqlite3_prepare_v2: no such column: vangelis
Whoops! I didn't mean to close the issue...
np, reopened it.
I need some more information about your system namely:
- Output of
uname -a
- GLib version
Btw did you create your database using walrus
?
If not please run walrus
first.
Then run mpdcron with --no-daemon
option and do eugene list 1
and paste the output please.
About the query strings, here are a few examples
- List all songs:
eugene list 1
- List artists, whose name is like vangelis:
eugene list -a "name like '%vangelis%'"
$ uname -a
Linux extensa 2.6.33-ARCH #1 SMP PREEMPT Sun May 2 08:21:02 UTC 2010 i686 Intel(R) Pentium(R) M processor 1.73GHz GenuineIntel GNU/Linux
glib v1.2.10-8
Yes, I created the DB with walrus
.
$ mpdcron --no-daemon
Trying to load module: stats
Added module suffix stats -> stats.so
Trying user configured path `/home/user/.mpdcron/modules/stats.so'
Trying system path `/usr/lib/mpdcron-0.3/modules/stats.so'
Found stats -> `/usr/lib/mpdcron-0.3/modules/stats.so'
[stats] Initializing
[stats] Successful bind to 0.0.0.0:6601
Loaded module `/usr/lib/mpdcron-0.3/modules/stats.so'
Connecting to `localhost' on port 6600 with timeout 0
Connected to Mpd server, running version 0.15.0
Sending idle command with mask 0xff
[stats] [0]! Connected
[stats] [0]< list "1"
[stats] [0]> id: 116
[stats] [0]> file: vangelis/blade-runner-ost-[esper-edition]/2-18-end-titles-[extended-version].mp3
[stats] [0]> id: 115
[stats] [0]> file: vangelis/blade-runner-ost-[esper-edition]/2-17-rachel-sleeps.mp3
...
[stats] [0]> id: 2
[stats] [0]> file: brian-eno/music-for-airports/01-1-1.mp3
[stats] [0]> id: 1
[stats] [0]> file: andi-muller/everything_andimullermix.mp3
[stats] [0]> OK
[stats] Write failed: Stream has outstanding operation
^C[stats] Exiting
Ah OK, SQL like syntax?
$ eugene list -a "name like '%vangelis%'"
Failed to list artist: EOF while trying to read a line
This one works fine
$ eugene list 1
1: andi-muller/everything_andimullermix.mp3
...
Ok I can reproduce the error:
[stats] Write failed: Stream has outstanding operation
Looks like a bug in the socket code. I'll see what I can do.
It also seems like play count is not being reported (which I assume is another consequence of this bug)
Any movement on this issue? I'm having the same issue.