예제 #1
0
 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()
예제 #2
0
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'])))
예제 #3
0
def cli(ctx, **kwargs):
    '''Music tags management'''
    ctx.obj.db = collection.Collection(**kwargs)
    ctx.obj.mf = filter.Filter(**kwargs)
예제 #4
0
def cli(ctx, **kwargs):
    '''Folder scanning'''
    lib.raise_limits()
    ctx.obj.db = collection.Collection(**kwargs)
예제 #5
0
def cli(ctx, **kwargs):
    '''Playlist management'''
    ctx.obj.db = collection.Collection(**kwargs)
예제 #6
0
def cli(ctx, **kwargs):
    '''Database management'''
    ctx.obj.db = collection.Collection(**kwargs)
    info(ctx.obj.db.connection_string())
예제 #7
0
def cli(ctx, **kwargs):
    '''Task management'''
    lib.raise_limits()
    ctx.obj.db = collection.Collection(**kwargs)
예제 #8
0
def cli(ctx, concurrency, **kwargs):
    '''Youtube management'''
    ctx.obj.db = collection.Collection(**kwargs)
    ctx.obj.mf = filter.Filter(**kwargs)
    ctx.obj.concurrency = concurrency