예제 #1
0
        private void OnSavePlayList()
        {
            currentSelectedItem = m_Facade.SelectedListItemIndex;
            string playlistFileName = string.Empty;

            if (GetKeyboard(ref playlistFileName))
            {
                string playListPath = string.Empty;
                playListPath = DBOption.GetOptions(DBOption.cPlaylistPath);
                playListPath = MediaPortal.Util.Utils.RemoveTrailingSlash(playListPath);

                // check if Playlist folder exists, create it if not
                if (!Directory.Exists(playListPath))
                {
                    try {
                        Directory.CreateDirectory(playListPath);
                    }
                    catch (Exception e) {
                        MPTVSeriesLog.Write("Error: Unable to create Playlist path: " + e.Message);
                        return;
                    }
                }

                string fullPlayListPath = Path.GetFileNameWithoutExtension(playlistFileName);

                fullPlayListPath += ".tvsplaylist";
                if (playListPath.Length != 0)
                {
                    fullPlayListPath = playListPath + @"\" + fullPlayListPath;
                }
                PlayList playlist = new PlayList();
                for (int i = 0; i < m_Facade.Count; ++i)
                {
                    GUIListItem  listItem     = m_Facade[i];
                    PlayListItem playListItem = new PlayListItem();
                    playListItem.Episode = listItem.TVTag as DBEpisode;
                    playlist.Add(playListItem);
                }
                PlayListIO saver = new PlayListIO();
                saver.Save(playlist, fullPlayListPath);
            }
        }
예제 #2
0
        private void OnSavePlayList()
        {
            currentSelectedItem = m_Facade.SelectedListItemIndex;
            string playlistFileName = string.Empty;
            if (GetKeyboard(ref playlistFileName))
            {
                string playListPath = string.Empty;
                playListPath = DBOption.GetOptions(DBOption.cPlaylistPath);
                playListPath = MediaPortal.Util.Utils.RemoveTrailingSlash(playListPath);

                // check if Playlist folder exists, create it if not
                if (!Directory.Exists(playListPath)){
                    try {
                        Directory.CreateDirectory(playListPath);
                    }
                    catch (Exception e){
                        MPTVSeriesLog.Write("Error: Unable to create Playlist path: " + e.Message);
                        return;
                    }
                }

                string fullPlayListPath = Path.GetFileNameWithoutExtension(playlistFileName);

                fullPlayListPath += ".tvsplaylist";
                if (playListPath.Length != 0)
                {
                  fullPlayListPath = playListPath + @"\" + fullPlayListPath;
                }
                PlayList playlist = new PlayList();
                for (int i = 0; i < m_Facade.Count; ++i)
                {
                    GUIListItem listItem = m_Facade[i];
                    PlayListItem playListItem = new PlayListItem();
                    playListItem.Episode = listItem.TVTag as DBEpisode;
                    playlist.Add(playListItem);
                }
                PlayListIO saver = new PlayListIO();
                saver.Save(playlist, fullPlayListPath);
            }
        }