Skip to content

Commit

Permalink
Add release group
Browse files Browse the repository at this point in the history
  • Loading branch information
alexankitty committed Nov 15, 2024
1 parent 255070f commit f018118
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
10 changes: 10 additions & 0 deletions lib/fileworker.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export async function parseOutFile(data) {
type: findType(fullName, data.catList),
date: innertext(file.querySelector(".date").innerHTML).trim(),
region: findRegion(fullName, data.catList),
group: findGroup(fullName)
};
return processedFile;
}
Expand Down Expand Up @@ -155,6 +156,15 @@ function findRegion(str, catList) {
return foundRegions.trim();
}

function findGroup(str){
if(str.includes('/')){
return str.split('/')[0]
}
else{
return ''
}
}

class HTTPResponseError extends Error {
constructor(response) {
super(`HTTP Error Response: ${response.status} ${response.statusText}`);
Expand Down
2 changes: 1 addition & 1 deletion lib/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export default class Searcher{
if(!this.miniSearch){
this.miniSearch = new MiniSearch({
fields: [...this.fields, 'hidden'],
storeFields: ['filename', 'category', 'type', 'date', 'size', 'region', 'path', 'id'],
storeFields: ['filename', 'category', 'type', 'date', 'size', 'region', 'path', 'id', 'group'],
processTerm: this.termProcessor
})
}
Expand Down
4 changes: 4 additions & 0 deletions views/pages/results.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<thead>
<tr>
<th>Name</th>
<th>Group</th>
<th>Category</th>
<th>Region</th>
<th>Type</th>
Expand All @@ -54,6 +55,9 @@
<%= results.items[x].filename %>
</a>
</td>
<td>
<%= results.items[x].group %>
</td>
<td>
<%= results.items[x].category %>
</td>
Expand Down

0 comments on commit f018118

Please sign in to comment.