public static string getVideoPath(string basePath, Video video, Album album, string sExt = ".mp4", bool hyphen = false, Playlist plist = null, bool artistBeforeTitle = false, int addYear = 0)
        {
            string sArtistStr = "";

            if (artistBeforeTitle && video.Artist != null)
            {
                sArtistStr = formatPath(video.Artist.Name) + " - ";
            }

            if (album != null)
            {
                string sRet = getAlbumFolder(basePath, album, addYear) + sArtistStr + formatPath(video.Title) + sExt;
                return(Path.GetFullPath(sRet));
            }
            else if (plist != null)
            {
                string sRet  = getPlaylistFolder(basePath, plist);
                string sChar = hyphen ? "- " : "";
                string sName = string.Format("{0} {1}{2}{3}{4}",
                                             (plist.Tracks.Count + plist.Videos.IndexOf(video) + 1).ToString().PadLeft(2, '0'),
                                             sChar,
                                             sArtistStr,
                                             formatPath(video.Title),
                                             sExt);
                return(Path.GetFullPath(sRet + sName));
            }
            else
            {
                string sRet = string.Format("{0}/Video/{1}{2}{3}", basePath, sArtistStr, formatPath(video.Title), sExt);
                return(Path.GetFullPath(sRet));
            }
        }
 public static string getCoverUrl(ref Playlist plist)
 {
     return(string.Format("http://images.tidalhifi.com/im/im?w={1}&h={1}&uuid={0}&rows=2&cols=3&noph", plist.UUID, PLAYLIST_COVER_SIZE));
 }
        public static string getPlaylistFolder(string basePath, Playlist plist)
        {
            string sRet = string.Format("{0}/Playlist/{1}/", basePath, formatPath(plist.Title));

            return(Path.GetFullPath(sRet));
        }
示例#4
0
 public static string getVideoPath(string basePath, Video video, Album album, string sExt = ".mp4", bool hyphen = false, Playlist plist = null)
 {
     if (album != null)
     {
         string sRet = getAlbumFolder(basePath, album) + formatPath(video.Title) + sExt;
         return(Path.GetFullPath(sRet));
     }
     else if (plist != null)
     {
         string sRet  = getPlaylistFolder(basePath, plist);
         string sChar = hyphen ? "- " : "";
         string sName = string.Format("{0} {1}{2}",
                                      (plist.Tracks.Count + plist.Videos.IndexOf(video)).ToString().PadLeft(2, '0'),
                                      sChar,
                                      sExt);
         return(Path.GetFullPath(sRet));
     }
     else
     {
         string sRet = string.Format("{0}/Video/{1}{2}", basePath, formatPath(video.Title), sExt);
         return(Path.GetFullPath(sRet));
     }
 }
示例#5
0
        public static string getTrackPath(string basePath, Album album, Track track, string sdlurl, bool hyphen = false, Playlist plist = null)
        {
            if (album != null)
            {
                string sAlbumDir = getAlbumFolder(basePath, album);
                string sTrackDir = sAlbumDir;
                if (album.NumberOfVolumes > 1)
                {
                    sTrackDir += "Volume" + track.VolumeNumber.ToString() + "/";
                }

                string sChar = hyphen ? "- " : "";
                string sName = string.Format("{0} {1}{2}",
                                             track.TrackNumber.ToString().PadLeft(2, '0'),
                                             sChar,
                                             formatPath(track.Title) + getExtension(sdlurl));

                string sRet = sTrackDir + sName;
                return(Path.GetFullPath(sRet));
            }
            else
            {
                string sPlistDir = getPlaylistFolder(basePath, plist);
                string sTrackDir = sPlistDir;
                string sChar     = hyphen ? "- " : "";
                string sName     = string.Format("{0} {1}{2}",
                                                 plist.Tracks.IndexOf(track).ToString().PadLeft(2, '0'),
                                                 sChar,
                                                 formatPath(track.Title) + getExtension(sdlurl));

                string sRet = sTrackDir + sName;
                return(Path.GetFullPath(sRet));
            }
        }
示例#6
0
        public static string getTrackPath(string basePath, Album album, Track track, string sdlurl,
                                          bool hyphen            = false, Playlist plist = null, string trackTitle = null,
                                          bool artistBeforeTitle = false, bool addexplicit = false, int addYear    = 0,
                                          bool useTrackNumber    = true)
        {
            //Get sArtistStr
            string sArtistStr = "";

            if (artistBeforeTitle && track.Artist != null)
            {
                sArtistStr = formatPath(track.Artist.Name) + " - ";
            }

            //Get Explicit
            string sExplicitStr = "";

            if (addexplicit && track.Explicit)
            {
                sExplicitStr = "(Explicit)";
            }

            string sRet = "";

            if (album != null)
            {
                string sAlbumDir = getAlbumFolder(basePath, album, addYear);
                string sTrackDir = sAlbumDir;
                if (album.NumberOfVolumes > 1)
                {
                    sTrackDir += "Volume" + track.VolumeNumber.ToString() + "/";
                }


                string sChar       = hyphen ? "- " : "";
                string trackNumber = track.TrackNumber.ToString().PadLeft(2, '0');

                string sPrefix = useTrackNumber ? $"{trackNumber} {sChar}" : "";
                string sTitle  = trackTitle == null?formatPath(track.Title) : formatPath(trackTitle);

                string sName = string.Format("{0}{1}{2}{3}{4}",
                                             sPrefix,
                                             sArtistStr,
                                             sTitle,
                                             sExplicitStr,
                                             getExtension(sdlurl));
                sRet = sTrackDir + sName;
            }
            else
            {
                string sPlistDir = getPlaylistFolder(basePath, plist);
                string sTrackDir = sPlistDir;

                string sChar       = hyphen ? "- " : "";
                string trackNumber = (plist.Tracks.IndexOf(track) + 1).ToString().PadLeft(2, '0');

                string sPrefix = useTrackNumber ? $"{trackNumber} {sChar}" : "";

                string sName = string.Format("{0}{1}{2}{3}",
                                             sPrefix,
                                             sArtistStr,
                                             trackTitle == null ? formatPath(track.Title) : formatPath(trackTitle),
                                             getExtension(sdlurl));
                sRet = sTrackDir + sName;
            }

            sRet = cutFilePath(sRet);
            return(Path.GetFullPath(sRet));
        }
示例#7
0
        public static string GetPlaylistFolderName(Playlist playlist)
        {
            string sRet = PathHelper.ReplaceLimitChar(playlist.Title, "-");

            return(sRet.Trim());
        }
        public static string getTrackPath(string basePath, Album album, Track track, string sdlurl, bool hyphen = false, Playlist plist = null, string trackTitle = null, bool artistBeforeTitle = false)
        {
            string sArtistStr = "";

            if (artistBeforeTitle && track.Artist != null)
            {
                sArtistStr = formatPath(track.Artist.Name) + " - ";
            }

            if (album != null)
            {
                string sAlbumDir = getAlbumFolder(basePath, album);
                string sTrackDir = sAlbumDir;
                if (album.NumberOfVolumes > 1)
                {
                    sTrackDir += "Volume" + track.VolumeNumber.ToString() + "/";
                }

                string sChar = hyphen ? "- " : "";
                string sName = string.Format("{0} {1}{2}{3}{4}",
                                             track.TrackNumber.ToString().PadLeft(2, '0'),
                                             sChar,
                                             sArtistStr,
                                             trackTitle == null ? formatPath(track.Title) : formatPath(trackTitle),
                                             getExtension(sdlurl));

                string sRet = sTrackDir + sName;
                return(Path.GetFullPath(sRet));
            }
            else
            {
                string sPlistDir = getPlaylistFolder(basePath, plist);
                string sTrackDir = sPlistDir;
                string sChar     = hyphen ? "- " : "";
                string sName     = string.Format("{0} {1}{2}{3}{4}",
                                                 (plist.Tracks.IndexOf(track) + 1).ToString().PadLeft(2, '0'),
                                                 sChar,
                                                 sArtistStr,
                                                 trackTitle == null ? formatPath(track.Title) : formatPath(trackTitle),
                                                 getExtension(sdlurl));

                string sRet = sTrackDir + sName;
                return(Path.GetFullPath(sRet));
            }
        }