anonradio: null checks
This commit is contained in:
		
							parent
							
								
									0936ce6937
								
							
						
					
					
						commit
						e212bade7b
					
				
					 1 changed files with 6 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -68,9 +68,14 @@ async function updateNowPlaying() {
 | 
			
		|||
  } else if (playing.startsWith("Coming up")) {
 | 
			
		||||
    title = playing;
 | 
			
		||||
  } else {
 | 
			
		||||
    const [_, current, peakDay, peakMonth, dj, metadata] = playing.match(
 | 
			
		||||
    const metadataLine = playing.match(
 | 
			
		||||
      /\[(\d+)\/(\d+)\/(\d+)\] \((.+?)\): (.+)/
 | 
			
		||||
    );
 | 
			
		||||
    const current = metadataLine?.[1] ?? "??";
 | 
			
		||||
    const peakDay = metadataLine?.[2] ?? "??";
 | 
			
		||||
    const peakMonth = metadataLine?.[3] ?? "??";
 | 
			
		||||
    const dj = metadataLine?.[4] ?? "unknown";
 | 
			
		||||
    const metadata = metadataLine?.[5] ?? "unknown";
 | 
			
		||||
 | 
			
		||||
    if (
 | 
			
		||||
      metadata == "https://archives.anonradio.net" ||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue