public IActionResult DownloadStreams(int id)
        {
            HandleDownloadStreamsLogic handleDownloadStreamsLogic = new HandleDownloadStreamsLogic();

            handleDownloadStreamsLogic.DownloadAllStreams(id);

            return(Ok());
        }
Example #2
0
        public Task Execute(IJobExecutionContext context)
        {
            JobDataMap jobDataMap = context.JobDetail.JobDataMap;
            HandleDownloadStreamsLogic handleDownloadStreamsLogic = new HandleDownloadStreamsLogic();

            handleDownloadStreamsLogic.GenerateVideoThumbnail(
                jobDataMap.GetLongValue("streamId"),
                jobDataMap.GetString("streamFile"));
            return(Task.CompletedTask);
        }
        public IActionResult DownloadSingleStream(long streamId)
        {
            using (var context = new MainDataContext()) {
                HandleDownloadStreamsLogic handleDownloadStreamsLogic = new HandleDownloadStreamsLogic();
                if (handleDownloadStreamsLogic.PrepareDownload(StreamHelpers.GetStreamDetails(streamId)))
                {
                    return(Ok());
                }
            }

            return(Conflict("Already exists."));
        }
Example #4
0
        public Task Execute(IJobExecutionContext context)
        {
            JobDataMap jobDataMap = context.JobDetail.JobDataMap;
            HandleDownloadStreamsLogic handleDownloadStreamsLogic = new HandleDownloadStreamsLogic();

            handleDownloadStreamsLogic.DownloadStream(
                (StreamExtended)jobDataMap["stream"],
                jobDataMap.GetString("title"),
                jobDataMap.GetString("streamDirectory"),
                jobDataMap.GetString("formatId"),
                jobDataMap.GetString("url"),
                jobDataMap.GetLongValue("youtubeDlVideoInfoDuration"),
                context.CancellationToken).Wait();
            return(Task.CompletedTask);
        }