def __init__(self, live_storage, mount, json_db): self.cover_art_dir = os.path.join(mount, '.miro', 'cover-art') self.net_lookup_enabled = app.config.get(prefs.NET_LOOKUP_BY_DEFAULT) self.mount = mount self.cursor = live_storage.cursor # track the next id that we should create in the database next_id = databaseupgrade.get_next_id(self.cursor) self.id_counter = itertools.count(next_id) self.select_paths_from_db() self.init_device_items(json_db)
def __init__(self, cursor, json_db, mount): self.cover_art_dir = os.path.join(mount, '.miro', 'cover-art') self.net_lookup_enabled = app.config.get(prefs.NET_LOOKUP_BY_DEFAULT) self.mount = mount self.cursor = cursor # track the next id that we should create in the database self.id_counter = itertools.count(databaseupgrade.get_next_id(cursor)) self.init_paths_in_metadata_table() self.init_device_items(json_db) self.process_items()