darkred / Userscripts

My userscripts
165 stars 24 forks source link

[TPB_helper] Sort order is messed up when search results are sorted by "date uploaded" #18

Closed NitroV closed 3 years ago

NitroV commented 3 years ago

Describe the bug

The sort order is all over the place once search results are sorted by the date uploaded.

To Reproduce

Steps to reproduce the behavior:

  1. Search for anything
  2. Click on "Uploaded" column

Expected behavior

Should be in proper ascending or descending order

Screenshots

image

Desktop (please complete the following information):

Additional context

The above screenshot shows when results are sorted in ascending order, it simply inverts when clicked again. Still incorrect.

Unrelated to the issue/Enhancement:

Please consider including dark theme for tpb as a part of helper extension. Themes can be found here, here or here.

darkred commented 3 years ago

This is rather complicated:


Unfortunately, there's nothing I can do to fix this:

tablesorter works on standard HTML tables (with THEAD and TBODY tags)

but the tpb search result tables are no longer standard HTML tables.

Also, I can't make tablesorter work only on a single column, nor disable the built-in sorting, then convert the whole table to standard (it would break the tables styling/layout, among other things).


I can only suggest to either avoid clicking to sort by the Uploaded header, or comment out line 383 of the script (convertDates();) to disable getting relative dates in search results. (the Display torrent timestamps in relative format: setting affects timestamps in torrent pages, not search results)


Regarding your suggestion, I use this userstyle https://userstyles.org/styles/150101/simple-dark-tpb and it's working fine, it applies even to TPB Helper settings, no need to add a theme to the script.