summaryrefslogtreecommitdiff
path: root/nephilim/clSong.py
diff options
context:
space:
mode:
Diffstat (limited to 'nephilim/clSong.py')
-rw-r--r--nephilim/clSong.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/nephilim/clSong.py b/nephilim/clSong.py
index 9b38076..c041b91 100644
--- a/nephilim/clSong.py
+++ b/nephilim/clSong.py
@@ -1,15 +1,11 @@
from PyQt4 import QtCore
-from misc import ORGNAME, APPNAME, sec2min
import os
-# compare two songs with respect to their album
-def isSameAlbum(song1, song2):
- return song1.getAlbum()==song2.getAlbum() \
- and song1.getTag('date')==song2.getTag('date')
+from misc import sec2min
class Song:
"""The Song class offers an abstraction of a song."""
- _data=None
+ _data = None
def __init__(self, data):
self._data=data
@@ -79,7 +75,9 @@ class Song:
def expand_tags(self, str):
"""Expands tags in form $tag in str."""
ret = str
+ ret = ret.replace('$title', self.getTitle()) #to ensure that it is set to at least filename
for tag in self._data:
ret = ret.replace('$' + tag, unicode(self._data[tag]))
+ ret = ret.replace('$songdir', os.path.dirname(self.getFilepath()))
return ret