예제 #1
0
        static async Task <ExitCode> Results(TaskCtx <ResultsOption> ctx)
        {
            var store  = ctx.Cfg.DataStore(ctx.Cfg.App.Storage.ResultsPath);
            var result = new YtResults(ctx.Cfg.App.Snowflake, ctx.Cfg.App.Results, store, ctx.Log);
            await result.SaveResults();

            return(ExitCode.Success);
        }
예제 #2
0
        static async Task <ExitCode> ChannelInfo(TaskCtx <ChannelInfoOption> ctx)
        {
            var yt = ctx.Cfg.YtClient(ctx.Log);
            var v  = await yt.VideoData(ctx.Option.VideoId);

            ctx.Log.Information("{ChannelId},{ChannelTitle}", v.ChannelId, v.ChannelTitle);
            return(ExitCode.Success);
        }
예제 #3
0
        static async Task <ExitCode> Update(TaskCtx <UpdateOption> ctx)
        {
            if (ctx.Option.ChannelIds.HasValue())
            {
                ctx.Cfg.App.LimitedToSeedChannels = ctx.Option.ChannelIds.UnJoin('|').ToHashSet();
            }

            var ytStore   = ctx.Cfg.YtStore(ctx.Log);
            var ytUpdater = new YtDataUpdater(ytStore, ctx.Cfg.App, ctx.Option.UpdateType, async() => await ctx.Cfg.App.Snowflake.OpenConnection(), ctx.Log);
            await ytUpdater.UpdateData();

            return(ExitCode.Success);
        }
예제 #4
0
        static async Task <ExitCode> Fleet(TaskCtx <UpdateFleetOption> ctx)
        {
            await YtContainerRunner.StartFleet(ctx.Log, ctx.Cfg, ctx.Option.UpdateType);

            return(ExitCode.Success);
        }
예제 #5
0
 static async Task <ExitCode> Fix(TaskCtx <FixOption> ctx)
 {
     await new StoreUpgrader(ctx.Cfg.App, ctx.Cfg.DataStore(), ctx.Log).UpgradeStore();
     return(ExitCode.Success);
 }
예제 #6
0
        static async Task <ExitCode> Sync(TaskCtx <SyncOption> ctx)
        {
            await SyncBlobs.Sync(ctx.Option.CsA, ctx.Option.CsB, ctx.Option.PathA, ctx.Option.PathB, ctx.Cfg.App.DefaultParallel, ctx.Log);

            return(ExitCode.Success);
        }