Exemple #1
0
        private static PlaylistFile GetPlaylistFileFromProdcastFile(DKRPodcastFileToProcess newFile)
        {
            var playlistFile = new PlaylistFile();

            playlistFile.File = newFile.DestinationPathForMp3;
            playlistFile.Title = Path.GetFileName(newFile.DestinationPathForMp3);
            playlistFile.Length = SecondsInMp3(newFile.DestinationPathForMp3);

            return playlistFile;
        }
Exemple #2
0
        private static PlaylistFile GetPlaylistFileFromPlaylistLine(string file, string title, string length)
        {
            var fileToUse = file.Split('=')[1];
            var titleToUse = title.Split('=')[1];
            var lengthToUse = length.Split('=')[1];

            int lengthInSeconds = 0;

            if (!int.TryParse(lengthToUse, out lengthInSeconds))
            {
                Log.Error(string.Format("Value '{0}' is not an int", lengthToUse), new Exception());
            }

            var playlistFile = new PlaylistFile()
            {
                File = fileToUse,
                Length = lengthInSeconds,
                Title = titleToUse
            };

            return playlistFile;
        }