Skip to content

Commit

Permalink
1.9.1 release
Browse files Browse the repository at this point in the history
  • Loading branch information
dchang0 committed Jan 1, 2024
1 parent c7581e7 commit 514e48a
Show file tree
Hide file tree
Showing 10 changed files with 66 additions and 43 deletions.
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -898,17 +898,20 @@ Code Changes
- renamed arrow.png to arrow-down.png
- removed ie.css

Next Version
1.9.1

Feature Changes

- added Super-Favorites Episodes filter

Next Version

IN PROGRESS

- merge Javascript-side's #clientError div and showClientError() into #twError div and $.fn.showErrorPanel()
- maybe merge PHP-side's #errorDialog div into #twError div

- Add Favorite and Hide Item in client buttons bar don't go away if the item is already in favorites or already hidden, respectively
- maybe hide Super-Favorites button if Super-Favorites are disabled
- if Transmission list is empty and cookie is older than 1 hour, switch to the All filter
- fix rare bug where button bar stays visible when multiple items are trashed from Transmission list
- fix vertical alignment of title line in Transmission filter on iPhone (first line of text sits too low and is too close to the progress bar)
Expand Down
29 changes: 24 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,34 @@ Common setups:
Status
===============

I've posted 1.9.0 with the changes listed in [CHANGELOG.md](CHANGELOG.md).
I've posted 1.9.1 with the changes listed in [CHANGELOG.md](CHANGELOG.md).

The Favorites and Super-Favorites dialogs now stay pinned open until closed, making it easier to do multiple Updates. This is a necessary change now that Super-Favorites can rapidly create dozens of Favorites that have to be edited/disabled. It was surprisingly difficult to add this feature due in part to a quirk in JQuery, probably explaining why the authors of TorrentWatch-X chose to simply force a reload of the page after every Update.
Super-Favorites now have an Episode filter that can be used to restrict the creation of Favorites to just the first episodes of the coming season.

Error messages on the Javascript side have been partially-consolidated towards the final goal of having just one error message div targeted by just one Javascript function and just one PHP function.
For instance, let's say you want to capture all the shows fansubbed by Subsplease, and you know that you will be watching the first episodes and deleting about half of the Favorites before the second episodes come out. You don't want the Super-Favorite to re-add the deleted Favorites when it sees the second episodes. So, the Super-Favorite would be set up like this:

I will probably consolidate the error message handling in 1.9.1 and stop adding features for a while, focusing on bugfixing the major 1.8.0 and 1.9.0 changes.
Name: Subsplease

Filter: Subsplease

Not:

Episodes: 1x1,2x1,3x1,4x1

Feed: All

Quality: 480p

This Super-Favorite will create a Favorite whenever it sees a Subsplease show that only has episode 1x1, 2x1, 3x1, or 4x1. This will capture the first episode of any season from 1 to 4 in 480p from any feed.

Now, there is a problem with shows that don't use season numbers and just continue sequentially where the last season left off. For example, let's say Edens Zero is going to start the next season at episode 51. You could change the Episodes filter to:

1x1,2x1,3x1,4x1,1x51

and it would also match Edens Zero episode 51 but not 52 and later. Having to plan ahead for Edens Zero's sequential numbering misses the point of Super-Favorites, though (it's easier to simply add a Favorite for Edens Zero like normal), so I'm trying to come up with a novel way to address this issue.

Still, the Episodes filter is extremely useful, so I am releasing it now on its own in 1.9.1.

It's my hope that I can then rewrite the PHP core of torrentwatch-xa to use OOP, specifically encapsulating its basic concepts (such as a Favorite or Feed Item) in object classes. Creating a Client class would allow others to inherit and write other Client classes so that other BitTorrent clients than Transmission can be hooked into torrentwatch-xa. This huge a change will catapult torrentwatch-xa into major version 2.0.0.

Please report any bugs using Github Issues.

Expand Down
20 changes: 16 additions & 4 deletions USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ For items not recognized as having an episodic numbering, Glummy ("_ ) is displa

Internally, the new Favorite matching engine uses direct comparisons of the separate season and episode as discrete numeric values and does not deal with this notation at all.

Later, when the Favorite Episodes filter functionality is implemented, it will also use this notation (except for Glummy, who is for display only).
Later, when the new Episodes filter functionality is implemented, it will also use this notation (except for Glummy, who is for display only).

The ideal notation for videos is actually SxVxEv# (Season x Volume x Episode version #); if downloading anime BluRay Disc sets becomes super-popular, I may implement this notation style throughout torrentwatch-xa in a future version.

### Current Episodes Filter Notation

The Episodes filter currently in each Favorite is still the old TorrentWatch-X filter. The notation style is the old style, like so:
The Episodes filter currently in use still uses the old TorrentWatch-X notation style, like so:

- SxE = single episode
- SxEp = single episode, PROPER or Repack
Expand Down Expand Up @@ -225,6 +225,8 @@ Filter: Erai-raws

Not: Bleach

Episodes:

Feed: All

Quality: 480p
Expand Down Expand Up @@ -267,9 +269,19 @@ After a few weeks, the Super-Favorite will have Favorited every item that matche

Obviously, Super-Favorites can create a lot of unwanted Favorites if the Filter and Not fields are poorly designed. Deleting erroneous Favorites is slow since they can only be deleted one by one, so Super-Favorites are disabled by default. New users should not enable them until after learning how the pattern matching style of their choice works.

Keep in mind that while a Super-Favorite is active, it doesn't make sense to delete any Favorites created by it while the episodic item is still ongoing. It will simply be re-added back the next time an episode of that item shows up in the feed. So, if you wish to stop a Favorite that was created by a Super-Favorite, change its Feed to None so that it will never match anything. As long as it exists with the same Name, the Super-Favorite can't re-add it. You can delete the Favorite after the season is done.
Keep in mind that while a Super-Favorite is active, it doesn't make sense to delete any Favorites created by it while the episodic item is still ongoing. The Favorite will simply be re-added back the next time an episode of that item matches the Super-Favorite. To address this, as of 1.9.1, each Super-Favorite now has an Episode filter.

Here is a common problem: as the current season ends and transitions into the next, the later episodes of shows that had a late start in the current season overlap with the early episodes of the shows starting early in the next season. Without an Episode filter, if you enable the Super-Favorite, it will end up re-adding Favorites for the outgoing shows that you may have deleted, but you want to capture the new incoming shows as soon as the first episodes are released.

To solve this, set the Episode filter to

1x1,2x1,3x1,4x1

causing the Super-Favorite to only create a Favorite if it matches the first episode in any season from 1 through 4, ignoring the later episodes of the shows of the outgoing season. With this, you can keep Super-Favorites turned on all the time and also delete Favorites for shows that were created by the Super-Favorites without having them be re-added by later episodes.

### Disable a Super-Favorite or Favorite

Using the same trick to disable an individual Favorite, you can also disable an individual Super-Favorite by setting its Feed to None. That will cause it to never match any item, thus preventing it from creating any Favorites.
You can disable an individual Super-Favorite or Favorite by setting its Feed to None.

### Authentication for Private RSS Feeds

Expand Down
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.9.0
1.9.1
4 changes: 1 addition & 3 deletions var/lib/torrentwatch-xa/lib/twxa_config_lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,6 @@ function updateSuperFavoriteFromgET() {
case 'Add':
case 'Update':
$response = addSuperFavoriteFromgET();
//writejSONConfigFile();
break;
case 'Delete':
$response = deleteSuperFavoriteFromgET();
Expand All @@ -467,7 +466,6 @@ function updateFavoriteFromgET() {
case 'Add':
case 'Update':
$response = addFavoriteFromgET();
//writejSONConfigFile();
break;
case 'Delete':
$response = deleteFavoriteFromgET();
Expand Down Expand Up @@ -559,7 +557,7 @@ function addSuperFavoriteFromgET() {
"not" => "Not",
//"downloaddir" => "Download Dir",
//"alsosavedir" => "Also Save Dir",
//"episodes" => "Episodes",
"episodes" => "Episodes",
"feed" => "Feed",
"quality" => "Quality",
//"seedratio" => "seedRatio"
Expand Down
17 changes: 10 additions & 7 deletions var/lib/torrentwatch-xa/lib/twxa_feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -517,12 +517,14 @@ function checkItemMatchesSuperFavorite($superfav, $item, $feedUrl, $matchStyle =
$ti = strtolower($item['title']);
if (checkItemTitleMatchesSuperFavorite($superfav, $ti, $feedUrl, $matchStyle)) {
$guessItem = detectMatch($ti);
if ($reqEpisInfo == 1) {
if ($guessItem['numberSequence'] > 0) {
// match
$itemMatchesSuperFave = true;
}
} else {
writeToLog("reqEpisodeInfo = $reqEpisInfo\n", 2);
if (
$reqEpisInfo != 1 ||
(
$guessItem['numberSequence'] > 0 &&
episode_filter($guessItem, $superfav['Episodes']) == true
)
) {
// match
$itemMatchesSuperFave = true;
}
Expand Down Expand Up @@ -717,7 +719,8 @@ function processOneFeed($feed, $idx, $feedName, $feedLink) {
$config_values['Super-Favorites'][$superfavKey],
$item,
$feed['URL'],
$matchStyle
$matchStyle,
$reqEpisInfo
)
) {
// item matches a Super-Favorite, create a Favorite from it
Expand Down
4 changes: 2 additions & 2 deletions var/www/html/torrentwatch-xa/javascript/torrentwatch-xa.js
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,7 @@ $(document).ready(function () { // first binding to document ready (while torren
if ($(superfavoriteiDPrefix).length) {
//$(superfavoriteiDPrefix + "_alsosavedir").attr("value", rsp.alsosavedir);
//$(superfavoriteiDPrefix + "_downloaddir").attr("value", rsp.downloaddir);
//$(superfavoriteiDPrefix + "_episodes").attr("value", rsp.episodes);
$(superfavoriteiDPrefix + "_episodes").attr("value", rsp.episodes);
// remove selected from all _feed options
$(superfavoriteiDPrefix + "_feed option").each(function () {
$(this).removeAttr("selected");
Expand All @@ -967,7 +967,7 @@ $(document).ready(function () { // first binding to document ready (while torren
$clone.find("#superfavorite_new_not").attr("id", "superfavorite_" + rsp.idx + "_not").attr("value", rsp.not);
//$clone.find("#superfavorite_new_downloaddir").attr("id", "superfavorite_" + rsp.idx + "_downloaddir").attr("value", rsp.downloaddir);
//$clone.find("#superfavorite_new_alsosavedir").attr("id", "superfavorite_" + rsp.idx + "_alsosavedir").attr("value", rsp.alsosavedir); // this might not exist if not enabled
//$clone.find("#superfavorite_new_episodes").attr("id", "superfavorite_" + rsp.idx + "_episodes").attr("value", rsp.episodes);
$clone.find("#superfavorite_new_episodes").attr("id", "superfavorite_" + rsp.idx + "_episodes").attr("value", rsp.episodes);
// remove selected from all _feed options
$clone.find("#superfavorite_new_feed option").each(function () {
$(this).removeAttr("selected");
Expand Down
2 changes: 1 addition & 1 deletion var/www/html/torrentwatch-xa/templates/superfavorites.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
'Not' => '',
//'Download Dir' => '',
//'Also Save Dir' => '',
//'Episodes' => '',
'Episodes' => '',
'Feed' => '',
'Quality' => '',
//'seedRatio' => ''
Expand Down
10 changes: 5 additions & 5 deletions var/www/html/torrentwatch-xa/templates/superfavorites_info.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@
<div class="right">
<input type="text" class="text" name="alsosavedir" id="superfavorite_<?php //echo $key; ?>_alsosavedir" value="<?php //echo $item['Also Save Dir']; ?>">
</div>
</div><?php //} ?>
<!--<div class="superfavorite_episodes">
</div><?php //} ?>-->
<div class="superfavorite_episodes">
<div class="left">
<label class="item" title="Episode filter. ex.: 1x1-3x24 for Season 1 Episode 1 to Season 3 Episode 24. To just set a starting point use: 2x10. You may use s01e12 instead of 1x12." >Episodes:</label>
<label class="item" title="Episode filter. ex.: 1x1-3x24 for Season 1 Episode 1 to Season 3 Episode 24. To just set one episode use: 2x10. You may use s01e12 instead of 1x12." >Episodes:</label>
</div>
<div class="right">
<input type="text" class="text" name="episodes" id="superfavorite_<?php //echo $key; ?>_episodes" title="Episodes filter. Please read the instructions on how to use this feature." value="<?php //echo $item['Episodes'] ?>">
<input type="text" class="text" name="episodes" id="superfavorite_<?php echo $key; ?>_episodes" title="Episodes filter. Please read the instructions on how to use this feature." value="<?php echo $item['Episodes'] ?>">
</div>
</div>-->
</div>
<div class="superfavorite_feed">
<div class="left">
<label class="item" title="Feed to match against">Feed:</label>
Expand Down
14 changes: 1 addition & 13 deletions var/www/html/torrentwatch-xa/torrentwatch-xa.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
require_once("config.php");
require_once("twxa_tools.php");

$twxa_version[0] = "1.9.0";
$twxa_version[0] = "1.9.1";
$twxa_version[1] = php_uname("s") . " " . php_uname("r") . " " . php_uname("m");

// parses commands sent from web UI (usually torrentwatch-xa.js)
Expand Down Expand Up @@ -54,24 +54,12 @@ function parse_options($twxa_version) {
case 'moveTo':
echo moveTorrent($_REQUEST['moveTo'], $_REQUEST['torHash']);
exit;
// case 'updateSuperFavorite':
// $response = updateSuperFavoriteFromgET();
// if (strpos($response, 'Error:') === 0) {
// echo "<div id=\"superfav_error\" class=\"dialog_window\" style=\"display: block\">$response</div>";
// }
// break;
case 'updateSuperFavorite':
$response = updateSuperFavoriteFromgET();
if(isset($response)) {
echo "$response";
}
exit;
// case 'updateFavorite':
// $response = updateFavoriteFromgET();
// if (strpos($response, 'Error:') === 0) {
// echo "<div id=\"fav_error\" class=\"dialog_window\" style=\"display: block\">$response</div>";
// }
// break;
case 'updateFavorite':
$response = updateFavoriteFromgET();
if(isset($response)) {
Expand Down

0 comments on commit 514e48a

Please sign in to comment.