Beispiel #1
0
        internal void SaveMoviesNonEnglishLibrary(Dictionary <string, MovieFile> _dictionary)
        {
            VideoFolder temp = new VideoFolder(this.location, this.title);

            foreach (var item in Enum.GetValues(typeof(Languages)))
            {
                if (_dictionary.ContainsKey(item.ToString()))
                {
                    string header   = item.ToString().Substring(0, 2);
                    string fileName = "index." + header + ".json";
                    if (DiskIO.IsFileExist(ContentLocation, fileName))
                    {
                        temp = DiskIO.DeserializeVideoFolderFromFile(ContentLocation, fileName);
                        temp.SetLocationTitle(this.location, this.title);
                        if (temp.HasMovieWithID(_dictionary[item.ToString()].id))
                        {
                            temp.RemoveMovieWithID(_dictionary[item.ToString()].id);
                        }
                        temp.library.Add(_dictionary[item.ToString()]);
                        temp.SaveMoviesLibrary(fileName);
                    }
                    else
                    {
                        temp.library = new List <MovieFile>();
                        temp.library.Add(_dictionary[item.ToString()]);
                        temp.SaveMoviesLibrary(fileName);
                    }
                }
            }
        }
Beispiel #2
0
        internal void RemoveMovieNonEnglishData(int _id)
        {
            VideoFolder temp = new VideoFolder(this.location, this.title);

            foreach (var item in Enum.GetValues(typeof(Languages)))
            {
                string header   = item.ToString().Substring(0, 2);
                string fileName = "index." + header + ".json";
                if (DiskIO.IsFileExist(ContentLocation, fileName))
                {
                    temp = DiskIO.DeserializeVideoFolderFromFile(ContentLocation, fileName);
                    temp.SetLocationTitle(this.location, this.title);
                    if (temp.HasMovieWithID(_id))
                    {
                        temp.RemoveMovieWithID(_id);
                    }
                    DiskIO.SaveAsJSONFile(temp, this.ContentLocation, fileName);
                }
            }
        }
Beispiel #3
0
        internal Dictionary <string, MovieFile> ReadNonEnglishDataLibrary(int _id)
        {
            Dictionary <string, MovieFile> retVal = new Dictionary <string, MovieFile>();
            VideoFolder temp = new VideoFolder(this.location, this.title);

            foreach (var item in Enum.GetValues(typeof(Languages)))
            {
                string header   = item.ToString().Substring(0, 2);
                string fileName = "index." + header + ".json";
                if (DiskIO.IsFileExist(ContentLocation, fileName))
                {
                    temp = DiskIO.DeserializeVideoFolderFromFile(ContentLocation, fileName);
                    temp.SetLocationTitle(this.location, this.title);
                    if (temp.HasMovieWithID(_id))
                    {
                        retVal.Add(item.ToString(), temp.FindMovieWithID(_id));
                    }
                }
            }
            return(retVal);
        }