public void TakeOffline(IEnumerable<PlaylistItem> playlistItems, long spaceRequired, string playlistFilename)
        {
            var offlinePlaylist = new OfflinePlaylist();

            foreach (var playlistItem in playlistItems)
            {
                var playlistItemCopy = playlistItem.Clone();
                ConvertPlaylistItemToOffline(playlistItemCopy);
                offlinePlaylist.Add(playlistItemCopy);
            }

            _offlineStorageManager.SerializeItemToFile(offlinePlaylist, playlistFilename);
            OfflineStorageManager.EnsureSpaceAvailable(spaceRequired);
            playlistItems.ForEach(TakeOffline);
        }
Example #2
0
        public void TakeOffline(IEnumerable <PlaylistItem> playlistItems, long spaceRequired, string playlistFilename)
        {
            var offlinePlaylist = new OfflinePlaylist();

            foreach (var playlistItem in playlistItems)
            {
                var playlistItemCopy = playlistItem.Clone();
                ConvertPlaylistItemToOffline(playlistItemCopy);
                offlinePlaylist.Add(playlistItemCopy);
            }

            _offlineStorageManager.SerializeItemToFile(offlinePlaylist, playlistFilename);
            OfflineStorageManager.EnsureSpaceAvailable(spaceRequired);
            playlistItems.ForEach(TakeOffline);
        }