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