Skip to content

Commit

Permalink
Support list view
Browse files Browse the repository at this point in the history
  • Loading branch information
Morea committed Apr 21, 2024
1 parent fd5966f commit 0e512e7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 3 additions & 1 deletion Find Unique Titles/dist/find.unique.titles.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,9 @@
return url.includes("avistaz.to");
}
async* getSearchRequest() {
const elements = Array.from(document.querySelector("#content-area > div.block > .row").children);
const rows = document.querySelectorAll("#content-area > div.block > .row");
let elements = Array.from(rows);
if (1 === rows.length) elements = Array.from(rows.item(0).children);
yield {
total: elements.length
};
Expand Down
8 changes: 5 additions & 3 deletions Find Unique Titles/src/trackers/AvistaZ.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ export default class AvistaZ implements tracker {
}

async *getSearchRequest(): AsyncGenerator<MetaData | Request, void, void> {
const elements = Array.from(
document.querySelector("#content-area > div.block > .row")!!.children
);
const rows = document.querySelectorAll("#content-area > div.block > .row");
let elements = Array.from(rows);
if (rows.length === 1) {
elements = Array.from(rows.item(0)!!.children);
}
yield {
total: elements.length,
};
Expand Down

0 comments on commit 0e512e7

Please sign in to comment.