File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ export default class AnghamiSource {
44 constructor ( nodelink ) {
55 this . nodelink = nodelink
66 this . config = nodelink . options
7- this . searchTerms = [ 'anghamisearch ' ]
7+ this . searchTerms = [ 'agsearch ' ]
88 this . patterns = [
99 / ^ h t t p s ? : \/ \/ (?: p l a y \. | w w w \. ) ? a n g h a m i \. c o m \/ (?: s o n g | a l b u m | p l a y l i s t | a r t i s t ) \/ ( \d + ) /
1010 ]
@@ -335,18 +335,19 @@ export default class AnghamiSource {
335335 }
336336
337337 buildTrack ( item ) {
338- const artworkUrl = item . coverArt
339- ? `https://angartwork.akamaized.net/?id=${ item . coverArt } &size=640`
338+ const artworkId = item . coverArt || item . AlbumArt || item . cover
339+ const artworkUrl = artworkId
340+ ? `https://artwork.anghcdn.co/?id=${ artworkId } &size=640`
340341 : null
341342
342343 const trackInfo = {
343344 identifier : item . id . toString ( ) ,
344345 isSeekable : true ,
345- author : item . artist ,
346- length : Math . round ( parseFloat ( item . duration ) * 1000 ) ,
346+ author : item . artist || item . artistName || 'Unknown Artist' ,
347+ length : Math . round ( parseFloat ( item . duration || 0 ) * 1000 ) ,
347348 isStream : false ,
348349 position : 0 ,
349- title : item . title ,
350+ title : item . title || item . name ,
350351 uri : `https://play.anghami.com/song/${ item . id } ` ,
351352 artworkUrl : artworkUrl ,
352353 isrc : null ,
@@ -535,4 +536,4 @@ class Reader {
535536 throw new Error ( "Unknown wire type: " + wireType ) ;
536537 }
537538 }
538- }
539+ }
You can’t perform that action at this time.
0 commit comments