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:
parent
32af513e83
commit
d6e6a72250
@ -11,3 +11,4 @@ add_subdirectory(digitallyimported-radio)
|
||||
add_subdirectory(google-covers)
|
||||
add_subdirectory(remove-duplicates)
|
||||
add_subdirectory(invalidate-deleted)
|
||||
add_subdirectory(nostalgia)
|
||||
|
6
scripts/nostalgia/CMakeLists.txt
Normal file
6
scripts/nostalgia/CMakeLists.txt
Normal file
@ -0,0 +1,6 @@
|
||||
install_script_files(nostalgia
|
||||
main.py
|
||||
nostalgia.jpg
|
||||
icon.png
|
||||
script.ini
|
||||
)
|
BIN
scripts/nostalgia/icon.png
Normal file
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
37
scripts/nostalgia/main.py
Normal 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()
|
BIN
scripts/nostalgia/nostalgia.jpg
Normal file
BIN
scripts/nostalgia/nostalgia.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 57 KiB |
9
scripts/nostalgia/script.ini
Normal file
9
scripts/nostalgia/script.ini
Normal 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
|
Loading…
x
Reference in New Issue
Block a user