コード例 #1
0
 public FileMover(IFileMoveWorker fileMoveWorker, ILogger <FileMover> logger, ISettings settings, IPlex plex)
 {
     _logger         = logger;
     _fileMoveWorker = fileMoveWorker;
     _settings       = settings;
     _plex           = plex;
 }
コード例 #2
0
 public CreateModel(IDatabase db, IPlex plex, IFileMover file)
 {
     //_context = context;
     _db   = db;
     _plex = plex;
     _file = file;
 }
コード例 #3
0
 public FileMoveWorker(IPlex plex, IJDownloader jDownloader, ISettings settings, ILogger <FileMoveWorker> logger)
 {
     _plex                = plex;
     _jDownloader         = jDownloader;
     _settings            = settings;
     _logger              = logger;
     _operationsPending   = new BlockingCollection <FileMoveOperation>();
     _allOperations       = new List <FileMoveOperation>();
     _allOperationsRWLock = new ReaderWriterLockSlim();
     _moveTask            = Task.Run(MoveWorker);
     _ID = 0;
 }
コード例 #4
0
ファイル: Series.cs プロジェクト: z3r0privacy/MovieMoverCore
        public List <(string key, string error)> IsValid(IPlex plex, IFileMover files, bool isNewEntry = false)
        {
            var errs = new List <(string key, string error)>();

            if (!plex.ResolvePlexId(this) && !isNewEntry)
            {
                errs.Add((nameof(Series) + "." + nameof(Name), "The given name could not be found on the Plex server."));
            }

            if (SearchNewEpisodes)
            {
                if (string.IsNullOrWhiteSpace(EpGuidesName))
                {
                    errs.Add((nameof(Series) + "." + nameof(EpGuidesName), "If searching for new episodes is enabled, a search name needs to be specified."));
                }
                if (string.IsNullOrWhiteSpace(SubtitlesName))
                {
                    if (isNewEntry)
                    {
                        SubtitlesName = Name;
                    }
                    else
                    {
                        errs.Add((nameof(Series) + "." + nameof(SubtitlesName), "If searching for new episodes is enabled, a search name needs to be specified."));
                    }
                }
                if (string.IsNullOrWhiteSpace(VideoSearch))
                {
                    if (isNewEntry)
                    {
                        VideoSearch = Name;
                    }
                    else
                    {
                        errs.Add((nameof(Series) + "." + nameof(VideoSearch), "If searching for new episodes is enabled, a search name needs to be specified."));
                    }
                }
            }

            if (errs.Count == 0)
            {
                if (!files.ValidateSeriesPath(this, isNewEntry))
                {
                    errs.Add((nameof(Series) + "." + nameof(DirectoryName), "The directory does not exist and could not be created."));
                }
            }

            return(errs);
        }
コード例 #5
0
 public EditModel(IDatabase db, IPlex plex, IFileMover file)
 {
     _db    = db;
     _plex  = plex;
     _files = file;
 }