async def setUp(self): lib.verbose = False self.collection = collection.Collection() await self.collection.clear() self.files = list(lib.find_files([folder1, folder2])) for f in self.files: m = file.File(f[1], f[0]) await self.collection.upsert(m) await self.collection.refresh()
async def cli(ctx, **kwargs): '''Generate some stats for music collection with filters''' ctx.obj.db = collection.Collection(**kwargs) ctx.obj.mf = filter.Filter(**kwargs) stats = await ctx.obj.db.stats(ctx.obj.mf) print("Music :", stats['musics']) print("Artist :", stats['artists']) print("Album :", stats['albums']) print("Genre :", stats['genres']) print("Keywords :", stats['keywords']) print("Size :", bytesToHuman(stats['size'])) print("Total duration :", str(timedelta(seconds=stats['duration'])))
def cli(ctx, **kwargs): '''Music tags management''' ctx.obj.db = collection.Collection(**kwargs) ctx.obj.mf = filter.Filter(**kwargs)
def cli(ctx, **kwargs): '''Folder scanning''' lib.raise_limits() ctx.obj.db = collection.Collection(**kwargs)
def cli(ctx, **kwargs): '''Playlist management''' ctx.obj.db = collection.Collection(**kwargs)
def cli(ctx, **kwargs): '''Database management''' ctx.obj.db = collection.Collection(**kwargs) info(ctx.obj.db.connection_string())
def cli(ctx, **kwargs): '''Task management''' lib.raise_limits() ctx.obj.db = collection.Collection(**kwargs)
def cli(ctx, concurrency, **kwargs): '''Youtube management''' ctx.obj.db = collection.Collection(**kwargs) ctx.obj.mf = filter.Filter(**kwargs) ctx.obj.concurrency = concurrency