Started client-side work on schedule searchin'
This commit is contained in:
parent
c081d9c4ff
commit
3ec770ba28
7 changed files with 196 additions and 24 deletions
|
|
@ -194,6 +194,30 @@ class channel{
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* searches through local un-archived queue for matching titles/urls
|
||||
* @param {String} title - Title of media to search for
|
||||
* @param {String} url - URL of media to search fo4
|
||||
*/
|
||||
searchQueue(title, url){
|
||||
//Create array to hold results of the search
|
||||
const results = [];
|
||||
|
||||
//Run through the local queue
|
||||
for(const rawEntry of this.queue.entries()){
|
||||
//Quick syntatic sugar XP
|
||||
const entry = rawEntry[1];
|
||||
//If the entry title includes our title search string, or the URL is an exact match
|
||||
if(((title != null && entry.title.includes(title)) || (url != null && entry.url == url)) && entry.status != "archived"){
|
||||
//Plop that fucker down
|
||||
results.push(entry);
|
||||
}
|
||||
}
|
||||
|
||||
//Return all found entries
|
||||
return results;
|
||||
}
|
||||
|
||||
/**
|
||||
* Processes and applies default config on any unset settings
|
||||
* @param {Boolean} force - Whether or not to forcefully reset already set settings
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue