Warning: session_start(): open(/tmp/sess_910dsohumqu6j42saqkd5kchb4, O_RDWR) failed: No space left on device (28) in /www/H01/htdocs/lib/base/lib_base.php on line 280
logger openDesktop.org
-
 KDE-Apps.org Applications for the KDE-Desktop 
 GTK-Apps.org Applications using the GTK Toolkit 
 GnomeFiles.org Applications for GNOME 
 MeeGo-Central.org Applications for MeeGo 
 CLI-Apps.org Command Line Applications 
 Qt-Apps.org Free Qt Applications 
 Qt-Prop.org Proprietary Qt Applications 
 Maemo-Apps.org Applications for the Maemo Plattform 
 Java-Apps.org Free Java Applications 
 eyeOS-Apps.org Free eyeOS Applications 
 Wine-Apps.org Wine Applications 
 Server-Apps.org Server Applications 
 apps.ownCloud.com ownCloud Applications 
--
-
 KDE-Look.org Artwork for the KDE-Desktop 
 GNOME-Look.org Artwork for the GNOME-Desktop 
 Xfce-Look.org Artwork for the Xfce-Desktop 
 Box-Look.org Artwork for your Windowmanager 
 E17-Stuff.org Artwork for Enlightenment 
 Beryl-Themes.org Artwork for the Beryl Windowmanager 
 Compiz-Themes.org Artwork for the Compiz Windowmanager 
 EDE-Look.org Themes for your EDE Desktop 
--
-
 Debian-Art.org Stuff for Debian 
 Gentoo-Art.org Artwork for Gentoo Linux 
 SUSE-Art.org Artwork for openSUSE 
 Ubuntu-Art.org Artwork for Ubuntu 
 Kubuntu-Art.org Artwork for Kubuntu 
 LinuxMint-Art.org Artwork for Linux Mint 
 Arch-Stuff.org Art And Stuff for Arch Linux 
 Frugalware-Art.org Themes for Frugalware 
 Fedora-Art.org Artwork for Fedora Linux 
 Mandriva-Art.org Artwork for Mandriva Linux 
--
-
 KDE-Files.org Files for KDE Applications 
 OpenTemplate.org Documents for OpenOffice.org
 GIMPStuff.org Files for GIMP
 InkscapeStuff.org Files for Inkscape
 ScribusStuff.org Files for Scribus
 BlenderStuff.org Textures and Objects for Blender
 VLC-Addons.org Themes and Extensions for VLC
--
-
 KDE-Help.org Support for your KDE Desktop 
 GNOME-Help.org Support for your GNOME Desktop 
 Xfce-Help.org Support for your Xfce Desktop 
--
openDesktop.orgopenDesktop.org:   Applications   Artwork   Linux Distributions   Documents    Linux42.org    OpenSkillz.com   
 
Home
Apps
Artwork
News
Groups
Knowledge
Events
Forum
People
Jobs
Register
Login


-
- Content .- Fans  .- Knowledge Base  . 

logger

   0.3.6  

Amarok Script

Score 75%
logger
zoom


Downloads:  176
Submitted:  May 28 2008
Updated:  Sep 16 2009

Description:

(For the Amarok 2 port of logger, see http://kde-apps.org/content/show.php?content=107836 )

logger is an Amarok script that logs all songs listened. The reason why I had to write it as a score script is that I wanted the information how long the song was listened. The script imitates the behaviour of the default score script. Additionally, each song (genre, artist, album, title) listened for more than 50 % is stored in an SQLite database (per month). So, nice statistics can be produced.

The database is located in ~/.kde/share/apps/amarok/scripts-data/logger.db.

The playstat script is an example statistics script. It can be run from a console (and will print some status messages to STDERR there) or from Amarok's script interface. It has an INI-Style configuration file at ~/.kde/share/apps/amarok/scripts-data/playstat.cfg (that will be created with the default configuration on the first run) that tells it which statistics should be made and will write the HTML output to ~/.kde/share/apps/amarok/scripts-data/playstat.htm by default. Feel free to experiment with it :-)

Version 0.3.3 introduces a few new configuration options for the playstat script. The best would perhaps be to remove your config file and let the playstat script generate a new default one.




Changelog:

2009-09-16 (Version 0.3.6)
Bugfix release. Fixed an UTF-8 problem with Python >=2.5 and made logger work again.

2009-03-08 (Version 0.3.5)
Bugfix release. Fixed a query problem when there are songs with the same name from different artists and made logger (hopefully) work if Amarok 1.* is started in KDE 4.

(See ChangeLog for the rest ;-)

2008-05-28 (Version 0.1):
Initial release




LicenseGPL
Send to a friend
Subscribe
Other  Content  from l3u
Report inappropriate content



-

 Error

 
 by tzd on: Jun 27 2008
 
Score 50%

Can't get it to work. Installed it and started "logger" in Amarok. The database file is created in the stated directory although nothing is being written to it.

I've changed permissions just in case to a=wrx but that didn't help.

The error I receive in Amarok after playing the song is this:

logger: Error processing file /media/mp3/Singles/Pop/Katie Melua - Crawling up a Hill.mp3

Would love to have it up and running since the whole idea with html outputs is great imho. Thanks so far! :)


Reply to this

-

 Re: Error

 
 by tzd on: Jun 27 2008
 
Score 50%

Just noticed the database dor this script is Sqllite. I'm not sure if my problem above is related to the fact that I'm running a regular Mysql database for Amarok?

Should also mention a few more details:
I'm on kubuntu Hardy (8.04) with kde 3.5.9 and Amarok 1.4.9.1


Reply to this

-

 Re: Re: Error

 
 by l3u on: Jun 28 2008
 
Score 50%

The database used by logger is independent of the database Amarok uses. I get this "Error processing file" error here if the song to log is not present in Amarok's database. When the dcop collection query call fails (when no data is retrieved), logger outputs this message. If the song _is_ in the database, I could imagine that the URL produced by logger to query the database is wrong and nothing is found.

Here, the songs are all in subdirectories of ~. This could cause the error ... the "url" col of the "tags" table in my database looks e. g. like this: "./tobias/Musik/Alben/Clawfinger/1993 Deaf Dumb Blind/07. Warfair.mp3". Could you check if an absolute path is used instead if the music is not inside the home directory? E. g. with "dcop amarok collection query 'select url from tags limit 10'"


Reply to this

-

 Re: Re: Error

 
 by l3u on: Jun 29 2008
 
Score 50%

Should be fixed with version 0.1.3 :-)


Reply to this

-

 Re: Re: Re: Error

 
 by tzd on: Jun 29 2008
 
Score 50%

Tried the new version but received the same error I'm afraid.

Also tried the command you told me to run and received the following output:

johan@Pingu:~$ dcop amarok collection query 'select url from tags limit 10'
./Singles/Alternative Electronic/St. Germain - La Goutte D'Or.mp3
./Singles/Alternative Electronic/St. Germain - Land Of.mp3
./Singles/Alternative Electronic/St. Germain - Montego Bay Spleen.mp3
./Singles/Alternative Electronic/St. Germain - Pont Des Arts.mp3
./Singles/Alternative Electronic/St. Germain - Rose Rouge.mp3
./Singles/Alternative Electronic/St. Germain - So Flute.mp3
./Singles/Alternative Electronic/St. Germain - Sure Thing.mp3
./Singles/Alternative Rock/Bad Cash Quartet - Big day coming.mp3
./Singles/Alternative Rock/Bad Cash Quartet - Competition ain't nothing.mp3
./Singles/Alternative Rock/Bad Cash Quartet - Heart attack.mp3
johan@Pingu:~$


Hope that might help? Thanks for your fast reply! :)


Reply to this

-

 Re: Re: Re: Re: Error

 
 by l3u on: Jun 30 2008
 
Score 50%

Okay ... here, it worked, I included some directory from /var and it worked after the fix ... so, where are your songs stored? Is the absolute path "/Singles/Alternative Electronic/..." or where is that directory? Do you know a little coding Python? I would really love to fix this issue ... but I can't reproduce it at the moment!


Reply to this

-

 Re: Re: Re: Re: Re: Error

 
 by tzd on: Jun 30 2008
 
Score 50%

I've got my Amarok collection on a separate partition that's mounted on /media/singles/X/Y

where X is a directory for genre, e.g. Rock and where Y is the actual song.

For instance, the full path to the song New years day by rockartist U2 would be:

/media/singles/rock/u2 - new years day.mp3

I'm afraid i don't know any python coding. If it would be possible to change it to the absolute path then perhaps it would work? Seems a little strange with the "." before /singles/..

Tell me what to do and I'll do it :)


Reply to this

-

 Re: Re: Re: Re: Re: Re: Error

 
 by tzd on: Jun 30 2008
 
Score 50%

UPDATE:

sorry got my path wrong there. The absolute path is instead:

/media/mp3/Singles/X/Y



-

 Re: Re: Re: Re: Re: Re: Error

 
 by l3u on: Jun 30 2008
 
Score 50%

I'm just trying to find out in which way one can get the database's url parameter out of the url parameter passed to the scripts in a convient way. Seems like the first directory, if it's /home or seomething else ... is replaced by a "./". On the other hand, it worked for me to just add a "." before a song located in /var here ... and /var was present in the database. Confusing. I posted a topic on the Amarok forums ( http://amarok.kde.org/forum/index.php/topic,15543.0.html ). Perhaps, somebody there knows the underlying mechanism. I'll let you know it ;-)



-

 Nice!

 
 by tzd on: Jun 30 2008
 
Score 50%

Cool, thanks :)


Reply to this

-

 Re: Nice!

 
 by l3u on: Jul 2 2008
 
Score 50%

Try version 0.1.4, it _really_ should work now ;-)


Reply to this

-

 version 0.1.4

 
 by tzd on: Jul 2 2008
 
Score 50%

Yeah, i think that thing works now since i don't get that error message anymore! :)

Instead i receive a new error message after the song has finished:


The script 'logger' ended with error code 1.

Traceback (most recent call last):
File "/home/johan/.kde/share/apps/amarok/scripts/logger/logger", line 174, in <module>
db.execute('INSERT INTO log(date, genre, artist, album, title, count) VALUES(?, ?, ?, ?, ?, ?)', (date, songInfo['genre'], songInfo['artist'], songInfo['album'], songInfo['title'], 1))
sqlite3.OperationalError: no such table: log


Reply to this

-

 Re: version 0.1.4

 
 by l3u on: Jul 2 2008
 
Score 50%

Try to delete ~/.kde/share/apps/amarok/scripts-data/logger.db -- it seems that the database does not contain the table it should contain. The database will be re-created after a new start.


Reply to this

-

 Re: Re: version 0.1.4

 
 by tzd on: Jul 2 2008
 
Score 50%

Yaay! That sure did the trick :) It logs to the db file now and no error messages... sweet!

Had a quick look on the playstat script which was a lot more editable than I originally thought.
I don't quite understand how I produce the web site or where it will be located?

When I try running the "playstat" script within Amarok nothing happens.

Haven't found any info regarding this so was hoping you could point me in any direction please ;)

Thanks for the amazingly fast replies and, not to forget, the patches!
Highly appreciated!


Reply to this

-

 Re: Re: Re: version 0.1.4

 
 by l3u on: Jul 3 2008
 
Score 50%

Thanks for the bug report ;-)

I added this to the readme file (and to the description above): "The current progress is written to stderr and the HTML is written to stdout, so do e. g. ./playstat > stat.htm on a console to have the HTML written to stat.htm"

The playstat script was only thought to be an example how the database could be queried to produce some statistics. Perhaps, one could modify it in a way that it can be configured and run from Amarok. I'll see ... :-)


Reply to this

-

 Re: Re: Re: Re: version 0.1.4

 
 by tzd on: Jul 4 2008
 
Score 50%

Thanks, got it to work now. If i dare, i might try to modify the script to fit my html needs :)

I wanted to file another bug report though. Noticed this today actually. When playing a few classical music mp3s i get an error message from logger saying it's unable to process the mp3.
I do believe this has to do with the name of my classical mp3 files.

For instance, a typical name for one of the songs would be:

Kirov Orchestra, Valery Gergiev - Act I, Tableau 1, Clara and the Nutcracker.mp3

I don't know if logger using the album info too. IF it does then for the above example it would also be:
Tchaikovsky: The Nutcracker, Op. 71

Basically all my classical tunes are very long when it comes to name.
Other mp3s with "smaller" names seems to work well.


Reply to this

-

 Error

 
 by l3u on: Jul 4 2008
 
Score 50%

Hi!

Artist, album, title and genre are logged by logger. I don't think that the length of the filename causes this error. Are you sure that the files are in the collection database? If so, it would be very interesting if the URL stored in the database differs from the actual url. If you know SQL a bit, you could search directly inside the database doing "sqlite3 ~/.kde/share/apps/amarok/collection.db", querying the table "tags". The data is not fetched from the mp3 (or whatever) files theirselves, but from Amarok's database. So the songs have to be indexed by Amarok.

Try modifying the playstat.py script from version 0.2 -- that should be way easier than modifying the previous versions :-)


Reply to this

-

 Re: Re: Re: Re: Re: version 0.1.4

 
 by l3u on: Jul 4 2008
 
Score 50%

P.S.

you can also search the database by simply doing (for example):

sqlite3 ~/.kde/share/apps/amarok/collection.db "SELECT url FROM tags WHERE url LIKE '%Tchaikovsky%'"

from a console.


Reply to this

-

 Re: Re: Re: Re: Re: Re: version 0.1.4

 
 by tzd on: Jul 4 2008
 
Score 50%

You are absolutely right my friend!
When playing the same songs again it works (before it wasn't in the collection).

Now when I have added and updated the collection everything is back to normal with perfect logging etc.

Sorry about the double post, updated the web page and it was posted twice unfortunately.

Will try the latest version with the improved script later on tonight or tomorrow.
Thanks once again for your support!



-

 Re: Re: Re: Re: version 0.1.4

 
 by tzd on: Jul 4 2008
 
Score 50%

Thanks, got it to work now. If i dare, i might try to modify the script to fit my html needs :)

I wanted to file another bug report though. Noticed this today actually. When playing a few classical music mp3s i get an error message from logger saying it's unable to process the mp3.
I do believe this has to do with the name of my classical mp3 files.

For instance, a typical name for one of the songs would be:

Kirov Orchestra, Valery Gergiev - Act I, Tableau 1, Clara and the Nutcracker.mp3

I don't know if logger using the album info too. IF it does then for the above example it would also be:
Tchaikovsky: The Nutcracker, Op. 71

Basically all my classical tunes are very long when it comes to name.
Other mp3s with "smaller" names seems to work well.


Reply to this

-

 playstat within amarok

 
 by tzd on: Jul 4 2008
 
Score 50%

Tried it out and man that's a nice feature :)
I have one question/suggestion:
Instead of having the web site that's being generated stored in scripts-data, would it be possible to store it in directly under the home folder? E.g. /home/username/playstat.htm

That way i don't have to browse around that much to find the actual web site.

Also, for the generated script, I recently came upon a web site that seems to have covers for 99.5% of all album releases. Since the scripts original web site only knows about 65% of my different albums it would be nice to use this site (www.discogs.com) instead for cover fetching.
Actually, the script would be amazing if it could use several sources for cover fetching :)

I don't know how difficult these suggestions are to implement and I also know you've left the script open for everyone else to develop. I was just suggesting above in case you're bored and wishes to improve it :P I'll have a look on it as well, but to be honest, I'm not much of a programmer. Hopefully I'll learn something and could improve some myself. :)


Reply to this

-

 Re: playstat within amarok

 
 by tzd on: Jul 4 2008
 
Score 50%

UPDATE: just had a look on the playstat script and I managed to change the html output directory very easily! Thanks for making it that easy :)


Reply to this

-

 Re: Re: playstat within amarok

 
 by tzd on: Jul 4 2008
 
Score 50%

When changing titles and other default text messages in the loggerStatistics file it works as long as I don't use Swedish characters. May I ask how to get this working please?

It works as long as I avoid the characters: 'å' 'ä' 'ö'

Cheers again :)


Reply to this

-

 Special Characters

 
 by l3u on: Jul 4 2008
 
Score 50%

You can't use non-ASCII characters in the Python source code by default. An easy way to do that is to write the characters as escaped Unicode characters.

E. g. u"\xe4" instead of "ä".

You can find out these character sequences by starting python in a console and doing the following:

from locale import getpreferredencoding
localEncoding = getpreferredencoding()

Then, you can do something like

"ÄÖÜäöü".decode(localEncoding)

and Python will print out the escaped Unicode string, e. g.:

u'\xc4\xd6\xdc\xe4\xf6\xfc'


Reply to this

-

 Re: Special Characters

 
 by tzd on: Jul 5 2008
 
Score 50%

I've tried it but it wouldn't work.

I've tried pasting this in Konsole:
from locale import getpreferredencoding
localEncoding = getpreferredencoding()

but all i get is:
from: can't read /var/mail/locale

i suppose i could reuse the code from your previous post although I'm still missing the letter: 'Å', 'å' :)


Reply to this

-

 Re: Re: Special Characters

 
 by l3u on: Jul 5 2008
 
Score 50%

You have to start the Python debugging console first by entering "python" in the shell. Bash does not know anything about Python commands and can'tr import any Python modules ;-)

The missing characters should be u"\xc5" for "Å" and u"\xe5" for "å".

(The "u" before the string indicated that the following string is Unicode-encoded, just to have said this :-)

Perhaps, we should do a i18n via gettext? Would be pretty cool, wouldn't it?! But perhaps, one should first make the statistisc script rock and be configurable by some GUI or at least an easy-to-understand configuration file ...


Reply to this

-

 Re: Re: Re: Special Characters

 
 by tzd on: Jul 6 2008
 
Score 50%

Ah that would explain why the commands wouldn't work :)

Thanks for your unicode translation! Will try to modify it now to fit my needs. I'll try to assist in any way possible to ease up the GUI for the web interface even though I'm not a programmer.
Hopefully there's something i can help with ;)



Add commentBack




-



 
 
 Who we are
Contact
More about us
Frequently Asked Questions
Register
Twitter
Blog
Explore
Apps
Artwork
Jobs
Knowledge
Events
People
Updates on identi.ca
Updates on Twitter
Content RSS   
Events RSS   

Participate
Groups
Forum
Add Content
Public API
About openDesktop.org
Legal Notice
Spreadshirt Shop
CafePress Shop
Advertising
Sponsor us
Report Abuse
 

Copyright 2007-2016 openDesktop.org Team  
All rights reserved. openDesktop.org is not liable for any content or goods on this site.
All contributors are responsible for the lawfulness of their uploads.
openDesktop is a trademark of the openDesktop.org Team