Example #1
0
        private string GetSceneName(DownloadClientItem downloadClientItem, LocalMovie localMovie)
        {
            if (downloadClientItem != null)
            {
                var sceneNameTitle = SceneChecker.GetSceneTitle(downloadClientItem.Title);
                if (sceneNameTitle != null)
                {
                    return(sceneNameTitle);
                }
            }

            var fileName      = Path.GetFileNameWithoutExtension(localMovie.Path.CleanFilePath());
            var sceneNameFile = SceneChecker.GetSceneTitle(fileName);

            if (sceneNameFile != null)
            {
                return(sceneNameFile);
            }

            var folderTitle = localMovie.FolderMovieInfo?.ReleaseTitle;

            if (folderTitle.IsNotNullOrWhiteSpace() && SceneChecker.IsSceneTitle(folderTitle))
            {
                return(folderTitle);
            }

            return(null);
        }
 public void should_correctly_parse_scene_names(string title, string result)
 {
     SceneChecker.GetSceneTitle(title).Should().Be(result);
 }