示例#1
0
 public ShellService(INovaromaEngine engine, IExceptionHandler exceptionHandler, IDialogService dialogService, MainViewModel mainViewModel)
 {
     _engine           = engine;
     _exceptionHandler = exceptionHandler;
     _dialogService    = dialogService;
     _mainViewModel    = mainViewModel;
 }
示例#2
0
        public static Task ManualDownload(INovaromaEngine engine, IExceptionHandler exceptionHandler, IDialogService dialogService, Movie movie)
        {
            var downloadable = (IDownloadable)movie;

            return(ManualDownload(engine, exceptionHandler, dialogService, movie, downloadable.GetSearchQuery(),
                                  downloadable.VideoQuality, downloadable.ExcludeKeywords, downloadable.MinSize, downloadable.MaxSize, movie.Directory));
        }
示例#3
0
        internal static Task NewMedia(INovaromaEngine engine, IExceptionHandler exceptionHandler, IDialogService dialogService, string searchQuery = null, string parentDirectory = null) {
            var viewModel = new NewMediaWizardViewModel(engine, exceptionHandler, dialogService);
            var t = viewModel.AddFromSearch(searchQuery, parentDirectory);

            new NewMediaWizard(viewModel).ForceShow();
            return t;
        }
示例#4
0
        internal static Task AddFromImdbId(INovaromaEngine engine, IExceptionHandler exceptionHandler, IDialogService dialogService, string imdbId) {
            var viewModel = new NewMediaWizardViewModel(engine, exceptionHandler, dialogService);
            var t = viewModel.AddFromImdbId(imdbId);

            new NewMediaWizard(viewModel).ForceShow();
            return t;
        }
示例#5
0
 public InfoSearchMediaViewModel(INovaromaEngine engine, IExceptionHandler exceptionHandler, IDialogService dialogService, string directory, bool isParentDirectory)
     : base(dialogService)
 {
     _engine            = engine;
     _exceptionHandler  = exceptionHandler;
     _directory         = directory;
     _isParentDirectory = isParentDirectory;
 }
示例#6
0
        public SettingsViewModel(INovaromaEngine engine, IDialogService dialogService, IConfigurable configurable): base(dialogService) {
            _engine = engine;
            _configurable = configurable;
            _settings = configurable.Settings;
            _initialValues = configurable.SerializeSettings();

            _editServiceSettingsCommand = new RelayCommand(EditServiceSettings);
        }
示例#7
0
        public static Task ManualDownload(INovaromaEngine engine, IExceptionHandler exceptionHandler, IDialogService dialogService, TvShowEpisode episode)
        {
            var downloadable = (IDownloadable)episode;
            var directory    = Novaroma.Helper.GetTvShowSeasonDirectory(engine.TvShowSeasonDirectoryTemplate, episode);

            return(ManualDownload(engine, exceptionHandler, dialogService, episode, downloadable.GetSearchQuery(),
                                  downloadable.VideoQuality, downloadable.ExcludeKeywords, downloadable.MinSize, downloadable.MaxSize, directory));
        }
示例#8
0
        internal static void EditSettings(INovaromaEngine engine, IDialogService dialogService, IConfigurable configurable, Window ownerWindow = null)
        {
            var settingsViewModel = new SettingsViewModel(engine, dialogService, configurable);
            var settingsWindow    = new SettingsWindow(settingsViewModel);

            settingsWindow.Owner = ownerWindow;
            settingsWindow.ShowDialog();
        }
示例#9
0
        internal static void WatchDirectory(INovaromaEngine engine, IExceptionHandler exceptionHandler, IDialogService dialogService, string directory = null)
        {
            var viewModel = new NewMediaWizardViewModel(engine, exceptionHandler, dialogService);

            viewModel.WatchDirectory(directory);

            new NewMediaWizard(viewModel).ForceShow();
        }
示例#10
0
        internal static Task AddFromImdbId(INovaromaEngine engine, IExceptionHandler exceptionHandler, IDialogService dialogService, string imdbId)
        {
            var viewModel = new NewMediaWizardViewModel(engine, exceptionHandler, dialogService);
            var t         = viewModel.AddFromImdbId(imdbId);

            new NewMediaWizard(viewModel).ForceShow();
            return(t);
        }
示例#11
0
        internal static Task NewMedia(INovaromaEngine engine, IExceptionHandler exceptionHandler, IDialogService dialogService, string searchQuery = null, string parentDirectory = null)
        {
            var viewModel = new NewMediaWizardViewModel(engine, exceptionHandler, dialogService);
            var t         = viewModel.AddFromSearch(searchQuery, parentDirectory);

            new NewMediaWizard(viewModel).ForceShow();
            return(t);
        }
示例#12
0
        public static void DiscoverMedia(INovaromaEngine engine, IExceptionHandler exceptionHandler, IDialogService dialogService, string parentDirectory = null)
        {
            var viewModel = new NewMediaWizardViewModel(engine, exceptionHandler, dialogService);

            viewModel.AddFromDiscover(parentDirectory);

            new NewMediaWizard(viewModel).ForceShow();
        }
 public DownloadSearchViewModel(INovaromaEngine engine, IExceptionHandler exceptionHandler, IDialogService dialogService, IDownloadable downloadable, string directory)
     : base(dialogService) {
     _engine = engine;
     _exceptionHandler = exceptionHandler;
     _downloadable = downloadable;
     _directory = directory;
     _searchCommand = new RelayCommand(DoSearch, CanSearch);
 }
示例#14
0
        public SettingsViewModel(INovaromaEngine engine, IDialogService dialogService, IConfigurable configurable) : base(dialogService)
        {
            _engine        = engine;
            _configurable  = configurable;
            _settings      = configurable.Settings;
            _initialValues = configurable.SerializeSettings();

            _editServiceSettingsCommand = new RelayCommand(EditServiceSettings);
        }
 public DownloadSearchViewModel(INovaromaEngine engine, IExceptionHandler exceptionHandler, IDialogService dialogService, IDownloadable downloadable, string directory)
     : base(dialogService)
 {
     _engine           = engine;
     _exceptionHandler = exceptionHandler;
     _downloadable     = downloadable;
     _directory        = directory;
     _searchCommand    = new RelayCommand(DoSearch, CanSearch);
 }
        public ScriptServicesWindow(INovaromaEngine engine, IDialogService dialogService) {
            _engine = engine;
            _dialogService = dialogService;
            _deleteScriptServiceCommand = new RelayCommand(DoDeleteScriptService);

            InitializeComponent();
            DataContext = this;

            Loaded += async (sender, args) => await LoadData();
        }
示例#17
0
        public static void InitTvShow(TvShow tvShow, INovaromaEngine engine)
        {
            var episodes = tvShow.Seasons.SelectMany(s => s.Episodes).ToList();

            episodes.ForEach(e => {
                if (!string.IsNullOrEmpty(e.FilePath) && !File.Exists(e.FilePath))
                {
                    e.FilePath           = string.Empty;
                    e.SubtitleDownloaded = false;
                }
                if (e.IsWatched)
                {
                    return;
                }

                e.BackgroundDownload         = true;
                e.BackgroundSubtitleDownload = engine.SubtitlesNeeded(tvShow.Language);
                e.SubtitleDownloaded         = false;
            });

            if (string.IsNullOrWhiteSpace(tvShow.Directory) || !Directory.Exists(tvShow.Directory))
            {
                return;
            }

            var files      = new DirectoryInfo(tvShow.Directory).GetFiles("*", SearchOption.AllDirectories).ToList();
            var videoFiles = files.Where(IsVideoFile).ToList();

            foreach (var videoFile in videoFiles)
            {
                int?season, episode;
                DetectEpisodeInfo(videoFile.NameWithoutExtension(), tvShow.Title, out season, out episode, videoFile, tvShow.Seasons.Max(s => s.Season));
                if (!season.HasValue || !episode.HasValue)
                {
                    continue;
                }

                var tvEpisode = episodes.FirstOrDefault(e => e.TvShowSeason.Season == season && e.Episode == episode.Value);
                if (tvEpisode == null)
                {
                    continue;
                }

                tvEpisode.BackgroundDownload = false;
                tvEpisode.NotFound           = false;
                tvEpisode.FilePath           = videoFile.FullName;
                var subtitleFilePath = GetSubtitleFilePath(videoFile);
                if (!string.IsNullOrEmpty(subtitleFilePath))
                {
                    tvEpisode.BackgroundSubtitleDownload = false;
                    tvEpisode.SubtitleNotFound           = false;
                    tvEpisode.SubtitleDownloaded         = true;
                }
            }
        }
        public ScriptServicesWindow(INovaromaEngine engine, IDialogService dialogService)
        {
            _engine        = engine;
            _dialogService = dialogService;
            _deleteScriptServiceCommand = new RelayCommand(DoDeleteScriptService);

            InitializeComponent();
            DataContext = this;

            Loaded += async(sender, args) => await LoadData();
        }
示例#19
0
        internal static void MovieDownloadCheck(object prm, INovaromaEngine engine)
        {
            var movie = prm as Movie;

            if (movie == null)
            {
                return;
            }

            movie.BackgroundSubtitleDownload = movie.BackgroundDownload && engine.SubtitlesNeeded(movie.Language);
        }
 public SubtitleSearchViewModel(INovaromaEngine engine, IExceptionHandler exceptionHandler, IDialogService dialogService, IDownloadable downloadable, FileInfo fileInfo)
     : base(dialogService) {
     _engine = engine;
     _exceptionHandler = exceptionHandler;
     _downloadable = downloadable;
     _fileInfo = fileInfo;
     _subtitleLanguages = new MultiCheckSelection<EnumInfo<Language>>(Constants.LanguagesEnumInfo);
     foreach (var subtitleLanguage in engine.SubtitleLanguages)
         _subtitleLanguages.Selections.First(s => s.Item.Item == subtitleLanguage).IsSelected = true;
     _searchCommand = new RelayCommand(DoSearch, CanSearch);
 }
示例#21
0
        private static Task ManualDownload(INovaromaEngine engine, IExceptionHandler exceptionHandler, IDialogService dialogService, IDownloadable downloadable,
                                           string searchQuery, VideoQuality videoQuality, string excludeKeywords, int?minSize, int?maxSize, string directory)
        {
            var viewModel = new DownloadSearchViewModel(engine, exceptionHandler, dialogService, downloadable, directory);
            var window    = new DownloadSearchWindow(viewModel);

            var t = viewModel.InitSearch(searchQuery, videoQuality, excludeKeywords, minSize, maxSize);

            window.ForceShow();
            return(t);
        }
示例#22
0
        internal static void AllTvDownloadCheck(object prm, INovaromaEngine engine)
        {
            var tvShow = prm as TvShow;

            if (tvShow == null || !tvShow.AllBackgroundDownload.HasValue)
            {
                return;
            }

            tvShow.AllBackgroundSubtitleDownload = tvShow.AllBackgroundDownload.Value && engine.SubtitlesNeeded(tvShow.Language);
        }
示例#23
0
        private static Task ManualSubtitleDownload(INovaromaEngine engine, IExceptionHandler exceptionHandler, IDialogService dialogService, FileInfo fileInfo, IDownloadable downloadable)
        {
            var searchQuery = downloadable != null?downloadable.GetSearchQuery() : fileInfo.NameWithoutExtension();

            var viewModel = new SubtitleSearchViewModel(engine, exceptionHandler, dialogService, downloadable, fileInfo);
            var window    = new SubtitleSearchWindow(viewModel);

            var t = viewModel.InitSearch(searchQuery);

            window.ForceShow();
            return(t);
        }
        public SimpleInfoSearchViewModel(INovaromaEngine engine, IExceptionHandler exceptionHandler, IDialogService dialogService, string searchQuery, string directory, bool isParentDirectory = false)
            : base(dialogService)
        {
            _engine            = engine;
            _exceptionHandler  = exceptionHandler;
            _searchQuery       = searchQuery;
            _directory         = directory;
            _isParentDirectory = isParentDirectory;

            _searchCommand     = new RelayCommand(DoSearch, CanSearch);
            _observableResults = new NovaromaObservableCollection <IInfoSearchMediaViewModel <IInfoSearchResult> >();
            _resultSelections  = new MultiCheckSelection <IInfoSearchMediaViewModel <IInfoSearchResult> >(_observableResults);
        }
示例#25
0
        internal static void EpisodeDownloadCheck(object prm, INovaromaEngine engine)
        {
            var episode = prm as TvShowEpisode;

            if (episode == null)
            {
                return;
            }

            var tvShow = episode.TvShowSeason.TvShow;

            episode.BackgroundSubtitleDownload = episode.BackgroundDownload && engine.SubtitlesNeeded(tvShow.Language);
        }
示例#26
0
        internal static void AllSeasonDownloadCheck(object prm, INovaromaEngine engine)
        {
            var season = prm as TvShowSeason;

            if (season == null || !season.AllBackgroundDownload.HasValue)
            {
                return;
            }

            var tvShow = season.TvShow;

            season.AllBackgroundSubtitleDownload = season.AllBackgroundDownload.Value && engine.SubtitlesNeeded(tvShow.Language);
        }
示例#27
0
 public SubtitleSearchViewModel(INovaromaEngine engine, IExceptionHandler exceptionHandler, IDialogService dialogService, IDownloadable downloadable, FileInfo fileInfo)
     : base(dialogService)
 {
     _engine            = engine;
     _exceptionHandler  = exceptionHandler;
     _downloadable      = downloadable;
     _fileInfo          = fileInfo;
     _subtitleLanguages = new MultiCheckSelection <EnumInfo <Language> >(Constants.LanguagesEnumInfo);
     foreach (var subtitleLanguage in engine.SubtitleLanguages)
     {
         _subtitleLanguages.Selections.First(s => s.Item.Item == subtitleLanguage).IsSelected = true;
     }
     _searchCommand = new RelayCommand(DoSearch, CanSearch);
 }
        public AdvancedInfoSearchViewModel(INovaromaEngine engine, IExceptionHandler exceptionHandler, IDialogService dialogService, string searchQuery, string directory, bool isParentDirectory)
            : base(dialogService)
        {
            _engine            = engine;
            _exceptionHandler  = exceptionHandler;
            _query             = searchQuery;
            _directory         = directory;
            _isParentDirectory = isParentDirectory;

            _searchCommand       = new RelayCommand(DoSearch, CanSearch);
            _clearFiltersCommand = new RelayCommand(ClearFilters);
            _observableResults   = new NovaromaObservableCollection <IInfoSearchMediaViewModel <IAdvancedInfoSearchResult> >();
            _resultSelections    = new MultiCheckSelection <IInfoSearchMediaViewModel <IAdvancedInfoSearchResult> >(_observableResults);

            var mediaTypeEnumInfo = Constants.MediaTypesEnumInfo;

            _mediaTypes = new MultiCheckSelection <EnumInfo <MediaTypes> >(mediaTypeEnumInfo.WithoutLast());
            _genres     = new MultiCheckSelection <string>(_engine.GetAdvancedInfoProviderGenres());
        }
        public NewMediaWizardViewModel(INovaromaEngine engine, IExceptionHandler exceptionHandler, IDialogService dialogService)
            : base(dialogService) {
            _engine = engine;
            _exceptionHandler = exceptionHandler;

            _movieDownloadCommand = new RelayCommand(DoDownloadMovie);
            _movieSubtitleDownloadCommand = new RelayCommand(DoDownloadMovieSubtitle);
            _movieDiscoverFilesCommand = new RelayCommand(DiscoverMovieFiles);
            _movieGoToDirectoryCommand = new RelayCommand(GoToMovieDirectory);
            _tvShowEpisodeDownloadCommand = new RelayCommand(DoDownloadTvShowEpisode);
            _tvShowEpisodeSubtitleDownloadCommand = new RelayCommand(DoDownloadTvShowEpisodeSubtitle);
            _tvShowDiscoverFilesCommand = new RelayCommand(DiscoverTvShowFiles);
            _tvShowGoToDirectoryCommand = new RelayCommand(GoToTvShowDirectory);
            _tvShowEpisodeDeleteCommand = new RelayCommand(DeleteTvShowEpisode, CanDeleteTvShowEpisode);
            _tvShowEpisodePlayCommand = new RelayCommand(PlayTvShowEpisode, CanPlayTvShowEpisode);
            _allTvDownloadCheckCommand = new RelayCommand(o => Helper.AllTvDownloadCheck(o, _engine));
            _allSeasonDownloadCheckCommand = new RelayCommand(o => Helper.AllSeasonDownloadCheck(o, _engine));
            _episodeDownloadCheckCommand = new RelayCommand(o => Helper.EpisodeDownloadCheck(o, _engine));
            _movieDownloadCheckCommand = new RelayCommand(o => Helper.MovieDownloadCheck(o, _engine));
        }
示例#30
0
        public NotifyIconViewModel(INovaromaEngine engine, IExceptionHandler exceptionHandler, ILogger logger, IDialogService dialogService)
            : base(dialogService) {
            _engine = engine;
            _exceptionHandler = exceptionHandler;
            _logger = logger;
            _pluginServices = engine.Services.OfType<IPluginService>();

            _showWindowCommand = new RelayCommand(ShowWindow);
            _newMediaCommand = new RelayCommand(NewMedia);
            _watchDirectoryCommand = new RelayCommand(WatchDirectory);
            _discoverCommand = new RelayCommand(Discover);
            _manualDownloadCommand = new RelayCommand(DoManualDownload);
            _executePluginServiceCommand = new RelayCommand(DoExecutePluginService);
            _executeDownloadsCommand = new RelayCommand(ExecuteDownloads);
            _executeTvShowUpdatesCommand = new RelayCommand(ExecuteTvShowUpdates);
            _backupDatabaseCommand = new RelayCommand(DoBackupDatabase);
            _manageRuntimeServicesCommand = new RelayCommand(ManageRuntimeServices);
            _clearLogsAndActivitiesCommand = new RelayCommand(DoClearLogsAndActivities);
            _checkForUpdatesCommand = new RelayCommand(CheckForUpdates);
            _exitApplicationCommand = new RelayCommand(ExitApplication);
        }
示例#31
0
        public NewMediaWizardViewModel(INovaromaEngine engine, IExceptionHandler exceptionHandler, IDialogService dialogService)
            : base(dialogService)
        {
            _engine           = engine;
            _exceptionHandler = exceptionHandler;

            _movieDownloadCommand                 = new RelayCommand(DoDownloadMovie);
            _movieSubtitleDownloadCommand         = new RelayCommand(DoDownloadMovieSubtitle);
            _movieDiscoverFilesCommand            = new RelayCommand(DiscoverMovieFiles);
            _movieGoToDirectoryCommand            = new RelayCommand(GoToMovieDirectory);
            _tvShowEpisodeDownloadCommand         = new RelayCommand(DoDownloadTvShowEpisode);
            _tvShowEpisodeSubtitleDownloadCommand = new RelayCommand(DoDownloadTvShowEpisodeSubtitle);
            _tvShowDiscoverFilesCommand           = new RelayCommand(DiscoverTvShowFiles);
            _tvShowGoToDirectoryCommand           = new RelayCommand(GoToTvShowDirectory);
            _tvShowEpisodeDeleteCommand           = new RelayCommand(DeleteTvShowEpisode, CanDeleteTvShowEpisode);
            _tvShowEpisodePlayCommand             = new RelayCommand(PlayTvShowEpisode, CanPlayTvShowEpisode);
            _allTvDownloadCheckCommand            = new RelayCommand(o => Helper.AllTvDownloadCheck(o, _engine));
            _allSeasonDownloadCheckCommand        = new RelayCommand(o => Helper.AllSeasonDownloadCheck(o, _engine));
            _episodeDownloadCheckCommand          = new RelayCommand(o => Helper.EpisodeDownloadCheck(o, _engine));
            _movieDownloadCheckCommand            = new RelayCommand(o => Helper.MovieDownloadCheck(o, _engine));
        }
示例#32
0
        public NotifyIconViewModel(INovaromaEngine engine, IExceptionHandler exceptionHandler, ILogger logger, IDialogService dialogService)
            : base(dialogService)
        {
            _engine           = engine;
            _exceptionHandler = exceptionHandler;
            _logger           = logger;
            _pluginServices   = engine.Services.OfType <IPluginService>();

            _showWindowCommand             = new RelayCommand(ShowWindow);
            _newMediaCommand               = new RelayCommand(NewMedia);
            _watchDirectoryCommand         = new RelayCommand(WatchDirectory);
            _discoverCommand               = new RelayCommand(Discover);
            _manualDownloadCommand         = new RelayCommand(DoManualDownload);
            _executePluginServiceCommand   = new RelayCommand(DoExecutePluginService);
            _executeDownloadsCommand       = new RelayCommand(ExecuteDownloads);
            _executeTvShowUpdatesCommand   = new RelayCommand(ExecuteTvShowUpdates);
            _backupDatabaseCommand         = new RelayCommand(DoBackupDatabase);
            _manageRuntimeServicesCommand  = new RelayCommand(ManageRuntimeServices);
            _clearLogsAndActivitiesCommand = new RelayCommand(DoClearLogsAndActivities);
            _checkForUpdatesCommand        = new RelayCommand(CheckForUpdates);
            _exitApplicationCommand        = new RelayCommand(ExitApplication);
        }
示例#33
0
        public static void InitMovie(Movie movie, INovaromaEngine engine)
        {
            FileInfo firstVideoFile = null;

            if (!string.IsNullOrWhiteSpace(movie.Directory) && Directory.Exists(movie.Directory))
            {
                var files = new DirectoryInfo(movie.Directory).GetFiles("*", SearchOption.AllDirectories).ToList();
                firstVideoFile = files.FirstOrDefault(IsVideoFile);
            }

            if (firstVideoFile != null)
            {
                movie.BackgroundDownload = false;
                movie.NotFound           = false;
                movie.FilePath           = firstVideoFile.FullName;
                var subtitleFilePath = GetSubtitleFilePath(firstVideoFile);
                if (!string.IsNullOrEmpty(subtitleFilePath))
                {
                    movie.BackgroundSubtitleDownload = false;
                    movie.SubtitleNotFound           = false;
                    movie.SubtitleDownloaded         = true;
                }
                else
                {
                    movie.BackgroundSubtitleDownload = engine.SubtitlesNeeded(movie.Language);
                    movie.SubtitleDownloaded         = false;
                }
            }
            else
            {
                movie.BackgroundDownload         = true;
                movie.FilePath                   = string.Empty;
                movie.BackgroundSubtitleDownload = engine.SubtitlesNeeded(movie.Language);
                movie.SubtitleDownloaded         = false;
            }
        }
示例#34
0
 public NewMediaViewModel(INovaromaEngine engine, IExceptionHandler exceptionHandler, IDialogService dialogService): base(dialogService) {
     _engine = engine;
     _exceptionHandler = exceptionHandler;
 }
示例#35
0
 public static Task ManualSubtitleDownload(INovaromaEngine engine, IExceptionHandler exceptionHandler, IDialogService dialogService, FileInfo fileInfo) {
     return ManualSubtitleDownload(engine, exceptionHandler, dialogService, fileInfo, null);
 }
示例#36
0
        public MainViewModel(INovaromaEngine engine, IExceptionHandler exceptionHandler, IDialogService dialogService, ILogger logger)
            : base(dialogService)
        {
            _engine           = engine;
            _exceptionHandler = exceptionHandler;
            _logger           = logger;
            _pluginServices   = engine.Services.OfType <IPluginService>();

            var genres = engine.MediaGenres;

            _movieSearchModel    = new MovieSearchModel(genres);
            _tvShowSearchModel   = new TvShowSearchModel(genres);
            _activitySearchModel = new ActivitySearchModel();

            _installUpdateCommand          = new RelayCommand(InstallUpdate);
            _aboutCommand                  = new RelayCommand(About);
            _newCommand                    = new RelayCommand(NewMedia);
            _watchDirectoryCommand         = new RelayCommand(WatchDirectory);
            _discoverCommand               = new RelayCommand(Discover);
            _manualDownloadCommand         = new RelayCommand(DoManualDownload);
            _executePluginServiceCommand   = new RelayCommand(DoExecutePluginService);
            _settingsCommand               = new RelayCommand(EditSettings);
            _executeDownloadsCommand       = new RelayCommand(ExecuteDownloads);
            _executeTvShowUpdatesCommand   = new RelayCommand(ExecuteTvShowUpdates);
            _backupDatabaseCommand         = new RelayCommand(DoBackupDatabase);
            _manageRuntimeServicesCommand  = new RelayCommand(ManageRuntimeServices);
            _clearLogsAndActivitiesCommand = new RelayCommand(DoClearLogsAndActivities);

            _saveSearchModelCommand        = new RelayCommand(DoSaveSearchModel);
            _movieSearchCommand            = new RelayCommand(DoGetMovies);
            _tvShowSearchCommand           = new RelayCommand(DoGetTvShows);
            _clearMovieSearchModelCommand  = new RelayCommand(DoClearMovieSearchModel);
            _clearTvShowSearchModelCommand = new RelayCommand(DoClearTvShowSearchModel);

            _moviePlayCommand             = new RelayCommand(PlayMovie, CanPlayMovie);
            _movieMarkWatchedCommand      = new RelayCommand(MarkMovieWatched, CanMarkMovieWatched);
            _movieUpdateInfoCommand       = new RelayCommand(DoUpdateMovieInfo);
            _movieDeleteCommand           = new RelayCommand(DoDeleteMovie);
            _movieSaveCommand             = new RelayCommand(DoSaveMovie);
            _movieDownloadCommand         = new RelayCommand(DoDownloadMovie);
            _movieSubtitleDownloadCommand = new RelayCommand(DoDownloadMovieSubtitle);
            _movieDiscoverFilesCommand    = new RelayCommand(DiscoverMovieFiles);
            _movieGoToDirectoryCommand    = new RelayCommand(GoToMovieDirectory);

            _tvShowPlayCommand = new RelayCommand(PlayTvShow, CanPlayTvShow);
            _tvShowMarkEpisodeWatchedCommand = new RelayCommand(MarkEpisodeWatched, CanMarkEpisodeWatched);
            _tvShowEpisodePlayCommand        = new RelayCommand(PlayTvShowEpisode, CanPlayTvShowEpisode);
            _tvShowEpisodeDeleteCommand      = new RelayCommand(DeleteTvShowEpisode, CanDeleteTvShowEpisode);
            _tvShowUpdateInfoCommand         = new RelayCommand(DoUpdateTvShowInfo);
            _tvShowDeleteCommand             = new RelayCommand(DoDeleteTvShow);
            _tvShowSaveCommand                    = new RelayCommand(DoSaveTvShow);
            _tvShowEpisodeDownloadCommand         = new RelayCommand(DoDownloadTvShowEpisode);
            _tvShowEpisodeSubtitleDownloadCommand = new RelayCommand(DoDownloadTvShowEpisodeSubtitle);
            _tvShowDiscoverFilesCommand           = new RelayCommand(DiscoverTvShowFiles);
            _tvShowGoToDirectoryCommand           = new RelayCommand(GoToTvShowDirectory);
            _activityPlayCommand                  = new RelayCommand(PlayActivity);

            _sendASmileCommand = new RelayCommand(SendASmile);
            _sendAFrownCommand = new RelayCommand(SendAFrown);

            _escapeKeyCommand = new RelayCommand(PressEscapeKey);

            _allTvDownloadCheckCommand     = new RelayCommand(o => Helper.AllTvDownloadCheck(o, _engine));
            _allSeasonDownloadCheckCommand = new RelayCommand(o => Helper.AllSeasonDownloadCheck(o, _engine));
            _episodeDownloadCheckCommand   = new RelayCommand(o => Helper.EpisodeDownloadCheck(o, _engine));
            _movieDownloadCheckCommand     = new RelayCommand(o => Helper.MovieDownloadCheck(o, _engine));

            _videoQualityEnumInfo = Constants.VideoQualityEnumInfo;

            _engine.MoviesChanged     += EngineOnMoviesChanged;
            _engine.TvShowsChanged    += EngineOnTvShowsChanged;
            _engine.ActivitiesChanged += EngineOnActivitiesChanged;
            _engine.LanguageChanged   += EngineOnLanguageChanged;

            _updateCheckTimer = new Timer(o => DoCheckForUpdate(), null, TimeSpan.FromSeconds(5), TimeSpan.FromHours(1));
        }
示例#37
0
        internal static void AllTvDownloadCheck(object prm, INovaromaEngine engine) {
            var tvShow = prm as TvShow;
            if (tvShow == null || !tvShow.AllBackgroundDownload.HasValue) return;

            tvShow.AllBackgroundSubtitleDownload = tvShow.AllBackgroundDownload.Value && engine.SubtitlesNeeded(tvShow.Language);
        }
示例#38
0
        private static Task ManualSubtitleDownload(INovaromaEngine engine, IExceptionHandler exceptionHandler, IDialogService dialogService, FileInfo fileInfo, IDownloadable downloadable) {
            var searchQuery = downloadable != null ? downloadable.GetSearchQuery() : fileInfo.NameWithoutExtension();

            var viewModel = new SubtitleSearchViewModel(engine, exceptionHandler, dialogService, downloadable, fileInfo);
            var window = new SubtitleSearchWindow(viewModel);

            var t = viewModel.InitSearch(searchQuery);
            window.ForceShow();
            return t;
        }
示例#39
0
 public DownloadJob(INovaromaEngine engine) {
     _engine = engine;
 }
示例#40
0
 public static Task ManualSubtitleDownload(INovaromaEngine engine, IExceptionHandler exceptionHandler, IDialogService dialogService, IDownloadable downloadable)
 {
     return(ManualSubtitleDownload(engine, exceptionHandler, dialogService, new FileInfo(downloadable.FilePath), downloadable));
 }
示例#41
0
 internal static void EditSettings(INovaromaEngine engine, IDialogService dialogService, IConfigurable configurable, Window ownerWindow = null) {
     var settingsViewModel = new SettingsViewModel(engine, dialogService, configurable);
     var settingsWindow = new SettingsWindow(settingsViewModel);
     settingsWindow.Owner = ownerWindow;
     settingsWindow.ShowDialog();
 }
示例#42
0
        private static Task ManualDownload(INovaromaEngine engine, IExceptionHandler exceptionHandler, IDialogService dialogService, IDownloadable downloadable,
                                           string searchQuery, VideoQuality videoQuality, string excludeKeywords, int? minSize, int? maxSize, string directory) {
            var viewModel = new DownloadSearchViewModel(engine, exceptionHandler, dialogService, downloadable, directory);
            var window = new DownloadSearchWindow(viewModel);

            var t = viewModel.InitSearch(searchQuery, videoQuality, excludeKeywords, minSize, maxSize);
            window.ForceShow();
            return t;
        }
示例#43
0
        public static void DiscoverMedia(INovaromaEngine engine, IExceptionHandler exceptionHandler, IDialogService dialogService, string parentDirectory = null) {
            var viewModel = new NewMediaWizardViewModel(engine, exceptionHandler, dialogService);
            viewModel.AddFromDiscover(parentDirectory);

            new NewMediaWizard(viewModel).ForceShow();
        }
示例#44
0
        internal static void WatchDirectory(INovaromaEngine engine, IExceptionHandler exceptionHandler, IDialogService dialogService, string directory = null) {
            var viewModel = new NewMediaWizardViewModel(engine, exceptionHandler, dialogService);
            viewModel.WatchDirectory(directory);

            new NewMediaWizard(viewModel).ForceShow();
        }
示例#45
0
 public static Task ManualDownload(INovaromaEngine engine, IExceptionHandler exceptionHandler, IDialogService dialogService, Movie movie) {
     var downloadable = (IDownloadable)movie;
     return ManualDownload(engine, exceptionHandler, dialogService, movie, downloadable.GetSearchQuery(), 
                           downloadable.VideoQuality, downloadable.ExcludeKeywords, downloadable.MinSize, downloadable.MaxSize, movie.Directory);
 }
示例#46
0
 public static Task ManualDownload(INovaromaEngine engine, IExceptionHandler exceptionHandler, IDialogService dialogService, TvShowEpisode episode) {
     var downloadable = (IDownloadable)episode;
     var directory = Novaroma.Helper.GetTvShowSeasonDirectory(engine.TvShowSeasonDirectoryTemplate, episode);
     return ManualDownload(engine, exceptionHandler, dialogService, episode, downloadable.GetSearchQuery(), 
                           downloadable.VideoQuality, downloadable.ExcludeKeywords, downloadable.MinSize, downloadable.MaxSize, directory);
 }
示例#47
0
 public static Task ManualSubtitleDownload(INovaromaEngine engine, IExceptionHandler exceptionHandler, IDialogService dialogService, FileInfo fileInfo)
 {
     return(ManualSubtitleDownload(engine, exceptionHandler, dialogService, fileInfo, null));
 }
示例#48
0
 public TvShowUpdateJob(INovaromaEngine engine)
 {
     _engine = engine;
 }
示例#49
0
 public static Task ManualDownload(INovaromaEngine engine, IExceptionHandler exceptionHandler, IDialogService dialogService)
 {
     return(ManualDownload(engine, exceptionHandler, dialogService, null, string.Empty, VideoQuality.Any, string.Empty, null, null, string.Empty));
 }
示例#50
0
 public static Task ManualSubtitleDownload(INovaromaEngine engine, IExceptionHandler exceptionHandler, IDialogService dialogService, IDownloadable downloadable) {
     return ManualSubtitleDownload(engine, exceptionHandler, dialogService, new FileInfo(downloadable.FilePath), downloadable);
 }
示例#51
0
 public ShellService(INovaromaEngine engine, IExceptionHandler exceptionHandler, IDialogService dialogService, MainViewModel mainViewModel) {
     _engine = engine;
     _exceptionHandler = exceptionHandler;
     _dialogService = dialogService;
     _mainViewModel = mainViewModel;
 }
示例#52
0
        internal static void MovieDownloadCheck(object prm, INovaromaEngine engine) {
            var movie = prm as Movie;
            if (movie == null) return;

            movie.BackgroundSubtitleDownload = movie.BackgroundDownload && engine.SubtitlesNeeded(movie.Language);
        }
示例#53
0
 public static Task ManualDownload(INovaromaEngine engine, IExceptionHandler exceptionHandler, IDialogService dialogService) {
     return ManualDownload(engine, exceptionHandler, dialogService, null, string.Empty, VideoQuality.Any, string.Empty, null, null, string.Empty);
 }
示例#54
0
 public SubtitleDownloadJob(INovaromaEngine engine) {
     _engine = engine;
 }
示例#55
0
        internal static void EpisodeDownloadCheck(object prm, INovaromaEngine engine) {
            var episode = prm as TvShowEpisode;
            if (episode == null) return;

            var tvShow = episode.TvShowSeason.TvShow;
            episode.BackgroundSubtitleDownload = episode.BackgroundDownload && engine.SubtitlesNeeded(tvShow.Language);
        }
示例#56
0
 public TvShowUpdateJob(INovaromaEngine engine) {
     _engine = engine;
 }
示例#57
0
        internal static void AllSeasonDownloadCheck(object prm, INovaromaEngine engine) {
            var season = prm as TvShowSeason;
            if (season == null || !season.AllBackgroundDownload.HasValue) return;

            var tvShow = season.TvShow;
            season.AllBackgroundSubtitleDownload = season.AllBackgroundDownload.Value && engine.SubtitlesNeeded(tvShow.Language);
        }