# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
-#
+#
# MPD_sima is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
-# along with MPD_sima. If not, see <http://www.gnu.org/licenses/>.
+# along with MPD_sima. If not, see <http://www.gnu.org/licenses/>.
import atexit
import os
Instanciate with Player replies.
"""
- def __init__(self, file=None, time=0, pos=0, **kwargs):
+ def __init__(self, file=None, time=0, pos=-1, **kwargs):
self.title = self.artist = self.album = self.albumartist = ''
- self._pos = pos
- self.empty = False
+ self.pos = pos
+ self._empty = False
self._file = file
if not kwargs:
- self.empty = True
+ self._empty = True
self.time = time
self.__dict__.update(**kwargs)
- self.tags_to_collapse = list(['artist', 'album', 'title', 'date',
- 'genre', 'albumartist'])
+ self.tags_to_collapse = ['artist', 'album', 'title', 'date',
+ 'genre', 'albumartist']
# have tags been collapsed?
self.collapse_tags_bool = False
self.collapsed_tags = list()
self.collapsed_tags.append(tag)
self.__dict__.update({tag: ', '.join(set(value))})
- def get_filename(self):
- """return filename"""
- if not self.file:
- return None
- return self.file
-
def __repr__(self):
return '%s(artist="%s", album="%s", title="%s", filename="%s")' % (
self.__class__.__name__,
return hash(self) != hash(other)
def __bool__(self):
- return not self.empty
-
- @property
- def pos(self):
- """return position of track in the playlist"""
- return int(self._pos)
+ return not self._empty
@property
def file(self):