Lines 526-535
Link Here
|
526 |
string strSongName; |
526 |
string strSongName; |
527 |
string strExplicit = String.Empty; |
527 |
string strExplicit = String.Empty; |
528 |
|
528 |
|
529 |
Hashtable meta = dict[ "metaData" ] != null ? |
529 |
Hashtable meta; |
530 |
(Hashtable)dict[ "metaData" ] : dict; |
530 |
|
|
|
531 |
if( dict[ "metaData" ] != null ) { |
532 |
meta = (Hashtable)dict[ "metaData" ]; |
533 |
} else if( dict[ "metadata" ] != null ) { |
534 |
meta = (Hashtable)dict[ "metadata" ]; |
535 |
} else { |
536 |
meta = dict; |
537 |
} |
538 |
|
539 |
strSongName = (string)meta[ "itemName" ]; |
531 |
|
540 |
|
532 |
strSongName = (string)meta[ "songName" ]; |
|
|
533 |
strTime = TimeSpan.FromSeconds( |
541 |
strTime = TimeSpan.FromSeconds( |
534 |
(int)meta[ "duration" ] / 1000 ).ToString(); |
542 |
(int)meta[ "duration" ] / 1000 ).ToString(); |
535 |
if( strTime.StartsWith( "00:" ) ) |
543 |
if( strTime.StartsWith( "00:" ) ) |
Lines 613-623
Link Here
|
613 |
|
621 |
|
614 |
if( song[ "downloadKey" ] == null ) |
622 |
if( song[ "downloadKey" ] == null ) |
615 |
{ |
623 |
{ |
616 |
Hashtable meta = song[ "metaData" ] != null ? |
624 |
Hashtable meta; |
617 |
(Hashtable)song[ "metaData" ] : song; |
|
|
618 |
|
625 |
|
619 |
PurchaseDialog dlg = new PurchaseDialog( MainWindow ); |
626 |
PurchaseDialog dlg = new PurchaseDialog( MainWindow ); |
620 |
|
627 |
|
|
|
628 |
if( song[ "metaData" ] != null ) { |
629 |
meta = (Hashtable)song[ "metaData" ]; |
630 |
} else if( song[ "metadata" ] != null ) { |
631 |
meta = (Hashtable)song[ "metadata" ]; |
632 |
} else { |
633 |
meta = song; |
634 |
} |
635 |
|
621 |
if( song[ "isAlbum" ] != null && (bool)song[ "isAlbum" ] == true ) |
636 |
if( song[ "isAlbum" ] != null && (bool)song[ "isAlbum" ] == true ) |
622 |
{ |
637 |
{ |
623 |
dlg.Title = "*"; |
638 |
dlg.Title = "*"; |
Lines 625-631
Link Here
|
625 |
} |
640 |
} |
626 |
else |
641 |
else |
627 |
{ |
642 |
{ |
628 |
dlg.Title = (string)meta[ "songName" ]; |
643 |
dlg.Title = (string)meta[ "itemName" ]; |
629 |
dlg.Artist = (string)meta[ "artistName" ]; |
644 |
dlg.Artist = (string)meta[ "artistName" ]; |
630 |
} |
645 |
} |
631 |
dlg.Album = (string)meta[ "playlistName" ]; |
646 |
dlg.Album = (string)meta[ "playlistName" ]; |
Lines 696-710
Link Here
|
696 |
RunOnMainThread.Run( this, "DoStatusbarUpdate", |
711 |
RunOnMainThread.Run( this, "DoStatusbarUpdate", |
697 |
new object[] { cidProgress, "Downloading", 2 } ); |
712 |
new object[] { cidProgress, "Downloading", 2 } ); |
698 |
|
713 |
|
699 |
Hashtable meta = song[ "metaData" ] != null ? |
714 |
Hashtable meta; |
700 |
(Hashtable)song[ "metaData" ] : song; |
|
|
701 |
|
715 |
|
702 |
byte [] sb = Store.DownloadSong( song, |
716 |
byte [] sb = Store.DownloadSong( song, |
703 |
new FairStore.Progress( DoProgressUpdate ) ); |
717 |
new FairStore.Progress( DoProgressUpdate ) ); |
704 |
|
718 |
|
705 |
string strFileName = String.Format( "{0} - {1} - {2}.m4a", |
719 |
string strFileName; |
706 |
meta[ "playlistArtistName" ], meta[ "playlistName" ], |
|
|
707 |
meta[ "songName" ] ); |
708 |
|
720 |
|
709 |
string [,] strReps = new string[,] |
721 |
string [,] strReps = new string[,] |
710 |
{ |
722 |
{ |
Lines 713-718
Link Here
|
713 |
{ "<", "" }, { ">", "" }, { "|", "" } |
725 |
{ "<", "" }, { ">", "" }, { "|", "" } |
714 |
}; |
726 |
}; |
715 |
|
727 |
|
|
|
728 |
if( song[ "metaData" ] != null ) { |
729 |
meta = (Hashtable)song[ "metaData" ]; |
730 |
} else if( song[ "metadata" ] != null ) { |
731 |
meta = (Hashtable)song[ "metadata" ]; |
732 |
} else { |
733 |
meta = song; |
734 |
} |
735 |
|
736 |
strFileName = String.Format( "{0} - {1} - {2}.m4a", |
737 |
meta[ "playlistArtistName" ], meta[ "playlistName" ], |
738 |
meta[ "itemName" ] ); |
739 |
|
716 |
for( int i = 0; i < strReps.Length / 2; i++ ) |
740 |
for( int i = 0; i < strReps.Length / 2; i++ ) |
717 |
{ |
741 |
{ |
718 |
strFileName = strFileName.Replace( strReps[ i, 0 ], |
742 |
strFileName = strFileName.Replace( strReps[ i, 0 ], |
Lines 1168-1174
Link Here
|
1168 |
|
1192 |
|
1169 |
private void ViewAlbumThread( object State ) |
1193 |
private void ViewAlbumThread( object State ) |
1170 |
{ |
1194 |
{ |
1171 |
string strPlaylistId = (string)State; |
1195 |
string strPlaylistId = State.ToString(); |
1172 |
|
1196 |
|
1173 |
try |
1197 |
try |
1174 |
{ |
1198 |
{ |