docs: function check(pathspec,pid_pref) {
  
  	var result = false;
  
  	filename = pathspec.split('\\');
  	filename = filename[filename.length-1];
  	if (filename.indexOf(pid_pref)>=0) {
  
  		result = true;
  
  		name = filename.split(pid_pref);
  		desc = name[0].split('_-_');
  		series = desc[0];
  		episode = desc[1];
  		if ((episode) && (episode.charAt(episode.length-1)=='_')) {
  			episode = episode.slice(0,episode.length-1);
  		}
  		if (!episode) {
  			episode = series;
  		}
  
  		name = name[1].split('.');
  		pid = name[0].split('_')[0];
  		pid = pid_pref+pid;
  
  		if (giUtils.binarySearch(download_history,pid)<0) {
  
  			suffix = name[1];
  			if ((suffix=='mp4') || (suffix=='mov')) {
  				type = 'tv';
  			}
  			else {
  				type = 'radio';
  			}
  
  			stat = fs.statSync(pathspec);
  			var time = Math.floor(stat.mtime.getTime()/1000);
  
  			entry = pid+'|'+series+'|'+episode+'|'+type+'|'+time+
  			  '|hlsaacstd1|'+pathspec+'|default,original|1800||||||||||';
  			console.log(pid+'|'+series+'|'+episode+'|'+type+'|'+time);
  			download_history.push(pid); //tail end is no longer sorted
  
  			entries.push(entry);
  
  		}
  		else {
  			//console.log('Already in history '+pid+' '+pathspec+' at index '+download_history.indexOf(pid));
  		}
  	}
  	return result;
  }