def delete(self, item):
if item.type == 'file' and item.path in self.file_id_lookup:
- del self.file_id_lookup[item.path]
+ self.log.debug("library: DELETE item from the database: %s" % item.format_debug_string())
+
+ if item.id in self:
+ del self[item.id]
+ if item.path in self.file_id_lookup:
+ del self.file_id_lookup[item.path]
self.files.remove(item.path)
self.save_dir_cache()
def free(self, id):
if id in self:
+ self.log.debug("library: cache freed for item: %s" % self[id].format_debug_string())
del self[id]
def free_all(self):
+ self.log.debug("library: all cache freed")
self.clear()
def build_dir_cache(self, bot):
self.type = "url"
def uri(self):
- return var.music_folder + self.path if self.path[0] != "/" else self.path
+ return self.path
def is_ready(self):
if self.downloading or self.ready != 'yes':
info = self._get_info_from_url()
self.validating_lock.release()
- if self.duration == 0 and not info:
+ if not info:
return False
if self.duration > var.config.getint('bot', 'max_track_duration') != 0: