def __make_track(self, artist, album, title, trackno, resource, mimetype): #f = self.call_service(msgs.CORE_SVC_GET_FILE, resource) #if (not f): return None path = File.pack_path("/tracks", artist, album, title, trackno, resource, mimetype) f = File(self) f.path = path f.is_local = True f.resource = resource f.name = title f.info = artist or "unknown" f.mimetype = mimetype f.acoustic_name = f.name + ", by " + f.info if (album == "All Tracks"): f.comparable = f.name.upper() else: f.comparable = trackno return f
def __make_folder(self, month, year): f = File(self) f.is_local = True f.path = File.pack_path("/months", str(month), str(year)) f.mimetype = "application/x-image-folder" f.resource = "" f.name = "%s %d" % (_MONTHS[month - 1], year) f.acoustic_name = "Folder: " + f.name f.comparable = 0 - ((year * 100) + month) #f.info = "%d items" % len(self.__folders.get(folder_name, [])) f.folder_flags = f.ITEMS_ENQUEUEABLE | \ f.ITEMS_COMPACT return f
def __make_album(self, ffolder, album): f = File(self) f.is_local = True f.path = File.pack_path("/albums", ffolder, album) f.name = album f.acoustic_name = f.name #f.info = artist f.mimetype = "application/x-music-folder" f.folder_flags = f.ITEMS_ENQUEUEABLE f.comparable = f.name if (album == "All Tracks"): f.icon = theme.mb_folder_audio.get_path() return f