1# Copyright 2005 Joe Wreschnig
2#           2016 Nick Boultbee
3#
4# This program is free software; you can redistribute it and/or modify
5# it under the terms of the GNU General Public License as published by
6# the Free Software Foundation; either version 2 of the License, or
7# (at your option) any later version.
8
9from quodlibet import _
10from quodlibet.qltk import Icons
11from quodlibet.plugins.songsmenu import SongsMenuPlugin
12from quodlibet.plugins.songshelpers import any_song, is_writable
13
14
15class ForceWrite(SongsMenuPlugin):
16    PLUGIN_ID = "Force Write"
17    PLUGIN_NAME = _("Update Tags in Files")
18    PLUGIN_DESC = _("Update modified tags in files. "
19                    "This will ensure play counts and ratings are up to date.")
20    PLUGIN_ICON = Icons.DOCUMENT_SAVE
21
22    plugin_handles = any_song(is_writable)
23
24    def plugin_song(self, song):
25        song._needs_write = True
26