Пример #1
0
        private static void parseSerie(dynamic xSerie, TimeLineModel timeLine)
        {
            if (xSerie != null)
            {
                foreach (dynamic xEpisode in xSerie.programmations)
                {
                    var serie = new EpisodeModel()
                    {
                        Id = int.Parse(xEpisode.id)
                    };

                    serie.VideoType = xEpisode.videotype;

                    if (serie.VideoType.Equals("local", StringComparison.OrdinalIgnoreCase))
                    {
                        parseLocalVideoUrl(serie, xEpisode);
                    }
                    else
                    {
                        serie.VideoUrl = xEpisode.url;
                    }

                    serie.EpisodeNumber = int.Parse(xEpisode.episodenumber);

                    timeLine.Episodes.Add(serie);
                }
            }
        }
Пример #2
0
        private static void parseLocalVideoUrl(EpisodeModel episode, dynamic xEpisode)
        {
            string[] parts = xEpisode.url.ToString().Split(';');

            string path = "";
            string filter = "";

            path = parts[0];

            if (parts.Length > 1)
            {
                filter = parts[1];
            }
            else
            {
                filter = "*.*";
            }

            parseLocalFile(path, filter, episode);
        }