Exemplo n.º 1
0
        /// <summary>
        /// Retrieve the files in all registered 7MC movie library folders, with extensions from Settings.Default.VideoFileExtensions
        /// </summary>
        /// <returns></returns>
        static FileBrowseResult GetMoviesInMovieLibrary()
        {
            FileBrowseResult output = new FileBrowseResult();

            CreateShellHelperIfNull();

            output.Directories = new List <BrowseItem>();

            MCLibraryFolderHelper fHelper      = new MCLibraryFolderHelper();
            List <string>         movieFolders = fHelper.MediaCenterLibraryFolders(MCLibraryFolderHelper.Libraries.Movie);

            List <string>     VideoFilters = filtersForMediaType(MediaFileTypes.Video);
            List <BrowseItem> filesFound   = new List <BrowseItem>();

            foreach (string movieFolder in movieFolders)
            {
                browseFolderForFiles(movieFolder, ref filesFound, VideoFilters, true);
            }

            // Now add recorded TV shows that are movies
            foreach (TVProgramme tvp in RecTV.Default.RecordedTVProgrammes.Values)
            {
                if (tvp.ProgramType != TVProgrammeType.Movie)
                {
                    continue;                                            // movies only
                }
                FileInfo   fi      = new FileInfo(tvp.Filename);
                BrowseItem newItem = fileInfoToBrowseItem(fi, true, true);
                filesFound.Add(newItem);
            }

            // Sort the list of movies alphabetically by filename (NAME not file path, path is stripped away by the comparer)
            CommonEPG.Comparers.BrowseItemComparer bComparer = new CommonEPG.Comparers.BrowseItemComparer();
            filesFound.Sort(bComparer);
            output.Files = filesFound;

            // Set base directory flag
            output.BaseDirectory = "MOVIE_LIBRARY";
            output.Success       = true;

            sHelper = null;

            return(output);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Retrieve the files in all registered 7MC movie library folders, with extensions from Settings.Default.VideoFileExtensions
        /// </summary>
        /// <returns></returns>
        static FileBrowseResult GetMoviesInMovieLibrary()
        {
            FileBrowseResult output = new FileBrowseResult();

            CreateShellHelperIfNull();

            output.Directories = new List<BrowseItem>();

            MCLibraryFolderHelper fHelper = new MCLibraryFolderHelper();
            List<string> movieFolders = fHelper.MediaCenterLibraryFolders(MCLibraryFolderHelper.Libraries.Movie);

            List<string> VideoFilters = filtersForMediaType(MediaFileTypes.Video);
            List<BrowseItem> filesFound = new List<BrowseItem>();
            foreach (string movieFolder in movieFolders)
            {
                browseFolderForFiles(movieFolder, ref filesFound, VideoFilters, true);
            }

            // Now add recorded TV shows that are movies
            foreach (TVProgramme tvp in RecTV.Default.RecordedTVProgrammes.Values)
            {
                if (tvp.ProgramType != TVProgrammeType.Movie) continue;  // movies only

                FileInfo fi = new FileInfo(tvp.Filename);
                BrowseItem newItem = fileInfoToBrowseItem(fi, true, true);
                filesFound.Add(newItem);
            }

            // Sort the list of movies alphabetically by filename (NAME not file path, path is stripped away by the comparer)
            CommonEPG.Comparers.BrowseItemComparer bComparer = new CommonEPG.Comparers.BrowseItemComparer();
            filesFound.Sort(bComparer);
            output.Files = filesFound;

            // Set base directory flag
            output.BaseDirectory = "MOVIE_LIBRARY";
            output.Success = true;

            sHelper = null;

            return output;
        }