File: reset.py

package info (click to toggle)
quodlibet-plugins 20080601-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 352 kB
  • ctags: 725
  • sloc: python: 4,001; makefile: 23; sh: 11
file content (22 lines) | stat: -rw-r--r-- 761 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Copyright 2006 Joe Wreschnig
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation
#
# $Id: reset.py 3644 2006-07-16 23:11:24Z piman $

from plugins.songsmenu import SongsMenuPlugin

class ResetLibrary(SongsMenuPlugin):
    PLUGIN_ID = "Reset Library Data"
    PLUGIN_NAME = _("Reset Library Data")
    PLUGIN_VERSION = "1"
    PLUGIN_DESC = "Reset ratings, play counts, skip counts, and play times."
    PLUGIN_ICON = 'gtk-refresh'

    def plugin_song(self, song):
        song["~#rating"] = 0.5
        for key in ["~#playcount", "~#skipcount", "~#lastplayed",
                    "~#laststarted"]:
            song[key] = 0