Exemple #1
0
        public static long GetTotalDownloadSize(object oData, string sType)
        {
            long lRet = 0;

            if (sType == "ALBUM")
            {
                Album album = (Album)oData;
                foreach (Track item in album.Tracks)
                {
                    lRet += DownloadFileHepler.GetFileLength(item.StreamUrl.Url);
                }
            }
            return(lRet);
        }
Exemple #2
0
        public static StreamUrl GetStreamUrl(string sID, string sQuality)
        {
            string sRet = Get("tracks/" + sID + "/streamUrl", new Dictionary <string, string>()
            {
                { "soundQuality", sQuality }
            }, 3);

            if (string.IsNullOrEmpty(sRet) || !string.IsNullOrEmpty(Errmsg))
            {
                return(null);
            }

            StreamUrl aRet = JsonHelper.ConverStringToObject <StreamUrl>(sRet);

            aRet.FileSize = DownloadFileHepler.GetFileLength(aRet.Url);
            return(aRet);
        }