1
0
mirror of https://github.com/clementine-player/Clementine synced 2025-01-29 02:29:56 +01:00

Add Nostalgia script.

This commit is contained in:
Tyler Rhodes 2011-07-08 10:18:09 +00:00
parent 32af513e83
commit d6e6a72250
6 changed files with 53 additions and 0 deletions

View File

@ -11,3 +11,4 @@ add_subdirectory(digitallyimported-radio)
add_subdirectory(google-covers)
add_subdirectory(remove-duplicates)
add_subdirectory(invalidate-deleted)
add_subdirectory(nostalgia)

View File

@ -0,0 +1,6 @@
install_script_files(nostalgia
main.py
nostalgia.jpg
icon.png
script.ini
)

BIN
scripts/nostalgia/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

37
scripts/nostalgia/main.py Normal file
View File

@ -0,0 +1,37 @@
import clementine
from PythonQt.QtGui import QAction
from PythonQt.Qt import QImage
import os
class Plugin:
def __init__(self):
self.path = os.path.dirname(__file__)
clementine.player.connect("SongChangeRequestProcessed(QUrl, bool)", self.Nostalgia)
self.action = QAction("Nostalgia-ize!", None)
self.action.setCheckable(True)
self.action.connect("changed()", self.Nostalgia)
clementine.ui.AddAction("extras_menu", self.action)
self.title = "Never Gonna' Give You Up"
self.artist = "Rick Astley"
self.album = "Whenever You Need Somebody"
self.image = QImage(os.path.join(self.path, "nostalgia.jpg"))
def Nostalgia(self):
if self.action.isChecked():
for item in clementine.playlists.current().GetAllItems():
temp = clementine.Song(item.Metadata())
temp.set_title(self.title)
temp.set_artist(self.artist)
temp.set_album(self.album)
temp.set_image(self.image)
item.SetTemporaryMetadata(temp)
else:
for item in clementine.playlists.current().GetAllItems():
item.ClearTemporaryMetadata()
clementine.playlists.current().PlaylistChanged()
plugin = Plugin()

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

View File

@ -0,0 +1,9 @@
[Script]
name=Nostalgia-izer
description=Brings back memories of the good ol\' times. Must be enabled in the \'Extras\' menu.
author=Tyler Rhodes <tyler.s.rhodes ( at ) gmail>
url=http://www.clementine-player.org
icon=icon.png
language=python
script_file=main.py