You are not logged in.

#1 2009-12-17 09:38:07

Rasi
Member
From: Germany
Registered: 2007-08-14
Posts: 1,914
Website

mpdcron - mpd-scrobbler/stats-database/command-execution-daemon

Mpdcron is a little utility that can execute user defined commands on certain mpd actions. It also acts as a last.fm scrobbler and a statistics database.

See post below for more detailed infos.

AUR package:
http://aur.archlinux.org/packages.php?ID=32890

It includes a README, a mpdcron.example and some example scripts which can be found in /usr/share/doc/mpdcron

See the scripts in action (used as an OSD):
http://karif.server-speed.net/~carnager/mpdcron_new.ogv

Last edited by Rasi (2010-01-05 10:55:42)


He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.

Douglas Adams

Offline

#2 2010-01-05 10:47:31

Rasi
Member
From: Germany
Registered: 2007-08-14
Posts: 1,914
Website

Re: mpdcron - mpd-scrobbler/stats-database/command-execution-daemon

mpdcron got a huge update. Its more a general mpd daemon now.

It can still execute any command on all sorts of actions. (with very fine-grained control over actions monitored)
In addition it has the following new features:


[Scrobbler]
It can act as a last.fm scrobbler (libre.fm too) using 1.2 protocol and support for mpds crossfading and repeating songs.

[Statistics database]
Supports loving, killing, rating and tagging songs, artists, albums and genres.
Tracks play count of songs, artist, albums and genres.
Implements a simple server protocol for remote clients to receive data
Import data from last.fm

[Notify-send]
Uses notify-send to send notifications.
Can detect repeated songs.


The new maintainer is alip in #mpd on freenode and the new homepage is http://alip.github.com/

Last edited by Rasi (2010-01-05 10:48:14)


He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.

Douglas Adams

Offline

#3 2010-01-05 11:16:56

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: mpdcron - mpd-scrobbler/stats-database/command-execution-daemon

Sounds nice, building it right now :-)

Offline

#4 2010-01-05 13:06:12

kaivalagi
Member
From: Norwich, UK
Registered: 2009-11-05
Posts: 145

Re: mpdcron - mpd-scrobbler/stats-database/command-execution-daemon

Looks interesting, I have been looking for something which will update coverart on the desktop on song changes and not poll all the time to know when the song changes. I've quickly looked through the documentation I am not sure whether a configuration can be setup to update a single fixed file with the coverart image for use in conky on song changes? Can mpdcron handle this sort of thing do you know guys?

I am at work right now, when I get home I'll have a play smile

Maybe a new feature needs adding to provide desktop art support, much like what I have seen available for Rhythmbox via plugins in the past...wouldn't be too far removed from the notification functionality I guess

Last edited by kaivalagi (2010-01-05 13:09:12)


Running Arch 64 (Made the switch to Arch 10/2009)
AUR | BZR

Offline

#5 2010-01-05 20:13:31

Rasi
Member
From: Germany
Registered: 2007-08-14
Posts: 1,914
Website

Re: mpdcron - mpd-scrobbler/stats-database/command-execution-daemon

kaivalagi wrote:

Looks interesting, I have been looking for something which will update coverart on the desktop on song changes and not poll all the time to know when the song changes. I've quickly looked through the documentation I am not sure whether a configuration can be setup to update a single fixed file with the coverart image for use in conky on song changes? Can mpdcron handle this sort of thing do you know guys?

I am at work right now, when I get home I'll have a play smile

Maybe a new feature needs adding to provide desktop art support, much like what I have seen available for Rhythmbox via plugins in the past...wouldn't be too far removed from the notification functionality I guess

Not sure if i understand you correctly. You want one file (an image) that dynamically gets overwritten on song change? there are scripts that will fetch the cover from some online source, you could tell mpdcron to run that script and show the cover afterwards with dzen2, notify-send or whatever.


He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.

Douglas Adams

Offline

#6 2010-01-05 20:24:05

kaivalagi
Member
From: Norwich, UK
Registered: 2009-11-05
Posts: 145

Re: mpdcron - mpd-scrobbler/stats-database/command-execution-daemon

Rasi wrote:
kaivalagi wrote:

Looks interesting, I have been looking for something which will update coverart on the desktop on song changes and not poll all the time to know when the song changes. I've quickly looked through the documentation I am not sure whether a configuration can be setup to update a single fixed file with the coverart image for use in conky on song changes? Can mpdcron handle this sort of thing do you know guys?

I am at work right now, when I get home I'll have a play smile

Maybe a new feature needs adding to provide desktop art support, much like what I have seen available for Rhythmbox via plugins in the past...wouldn't be too far removed from the notification functionality I guess

Not sure if i understand you correctly. You want one file (an image) that dynamically gets overwritten on song change? there are scripts that will fetch the cover from some online source, you could tell mpdcron to run that script and show the cover afterwards with dzen2, notify-send or whatever.

That's what I meant smile

I have mpdcron setup now scrobbling to last.fm for now, I'll do some reading on how to trigger a script call on a particular event

Nifty MPD app for sure, I was surprised how easy it is to add your own custom modules looking at the example C, I might have to look at creating something to do what I want in C code (script first though - I want cover art support soon(ish) smile

Thanks

Edit: I've setup a "player" hook to call a shell script which copies the coverart if found to a specific file name, this will sort me out for now...thanks again. There doesn't seem to be any requirement to write a C module for anything using hooks! Can use python scripts instead, far simpler smile

Last edited by kaivalagi (2010-01-05 21:13:54)


Running Arch 64 (Made the switch to Arch 10/2009)
AUR | BZR

Offline

#7 2010-01-13 18:39:15

kaivalagi
Member
From: Norwich, UK
Registered: 2009-11-05
Posts: 145

Re: mpdcron - mpd-scrobbler/stats-database/command-execution-daemon

Hi Guys,

Anyone had this issue before? I am running a couple of scripts off the player hook and they are executing as expected. However both these scripts sole purpose is to provide lyrics and coverart in a default location to be picked up, the files are created but are missing any rights at all.

Here's my lyrics.sh script which is pointed to by the player hook:

#!/usr/bin/env sh

# get lyrics (if found) and copy it to /tmp/lyrics
lyricsfile="$HOME/.lyrics/$MPD_SONG_TAG_ARTIST-$MPD_SONG_TAG_TITLE.txt"
outputlyricsfile="/tmp/lyrics.txt"
if [ -f "$lyricsfile" ]; then
    rm -f "$outputlyricsfile"

    echo "lyrics.sh - Copying cover file '$lyricsfile' to /tmp/lyrics"
    cp "$lyricsfile" "$outputlyricsfile"

    echo "chown mark:users \"$outputlyricsfile\""
    chown mark:users "$outputlyricsfile"

    echo "chmod +rwx \"$outputlyricsfile\""
    chmod +rwx "$outputlyricsfile"
fi

The resultant output from listing the file is as follows:

---------- 1 mark users 641 Jan 13 18:34 /tmp/lyrics.txt

Note the solid dashes, there are no read, write or wexecute rights associated, so nothing can read it sad

If you look in the script above I have tried to remedy it using chmod +rwx but it doesn't work

Any ideas? I assumed that mpdcron ran as the current user, especially considering it is started for me when I login (startup apps), so this shouldn't happen right?

EDIT: Didn't get to the bottom of the problem but found a work around, sym linked the files rather than copying them smile

Last edited by kaivalagi (2010-01-14 17:30:06)


Running Arch 64 (Made the switch to Arch 10/2009)
AUR | BZR

Offline

#8 2010-04-28 12:51:13

gladstone
Member
Registered: 2009-01-03
Posts: 74

Re: mpdcron - mpd-scrobbler/stats-database/command-execution-daemon

I'm having a problem with the stats module of mpdcron; would anyone kind enough care to take a look?

Last edited by gladstone (2010-04-28 12:56:52)

Offline

#9 2010-07-20 03:49:07

jck
Member
From: USA
Registered: 2009-05-08
Posts: 98

Re: mpdcron - mpd-scrobbler/stats-database/command-execution-daemon

@gladstone, just add "require 'date'"

Offline

#10 2013-11-27 17:05:34

hariskar
Member
From: Greece/Kavala
Registered: 2012-10-16
Posts: 185

Re: mpdcron - mpd-scrobbler/stats-database/command-execution-daemon

mpdcron does not start as a daemon, it gives me
Daemon returned 2 as return value

Also with
$ homescrape hariskar

nothing happens. Any idea?
Thank you

Last edited by hariskar (2015-03-20 04:59:02)

Offline

Board footer

Powered by FluxBB