Regarding the bug
https://ted.nu/forum/viewtopic.php?t=1831 , i have written a small patch that now checks every file inside a torrent for a match with the keywords. so if you add wmv to the filter list, rather than just checking in the feed/torrent name for a match, if the file itself matches one of the keywords, it will be ignored.
Code:
Index: ted/TedParser.java
===================================================================
--- ted/TedParser.java (revision 731)
+++ ted/TedParser.java (working copy)
@@ -731,6 +731,12 @@
}
}
+ if(containsFilteredItems(torrent, serie))
+ {
+ // Log message not translated!
+ parseLogInfo[itemNr][1] = "Contains filtered keywors";
+ return;
+ }
// get torrent state (for seeders)
try {
int torrentSeeders = 0;
@@ -971,6 +977,36 @@
return matchesHDKeywords && matchesNormalKeywords;
}
+ private boolean containsFilteredItems(TorrentImpl torrent,TedSerie serie)
+ {
+ boolean containsFilteredItems = false;
+ TorrentInfo torrentInfo = torrent.getInfo();
+ TorrentFile[] files;
+
+ // check if the torrent contains multpile files
+ if(!torrentInfo.isSingleFile())
+ {
+ files = torrentInfo.getMultiFile();
+ String name;
+
+ for(int i = 0; i < files.length;i++)
+ {
+ name = files[i].getPath().toString();
+ if(tPKeyChecker.checkKeywords(name, serie.getKeywords()))
+ {
+ containsFilteredItems = true;
+ }
+ }
+ } else
+ {
+ if(tPKeyChecker.checkKeywords(torrentInfo.getName(),serie.getKeywords()))
+ {
+ containsFilteredItems = true;
+ }
+ }
+ return containsFilteredItems;
+ }
+
/**
* Checks if torrent contains compressed files
*
@@ -993,7 +1029,8 @@
for (int i = 0; i < files.length; i++)
{
name = files[i].getPath().toString();
- type = name.substring(name.length() - 3);
+ // get the file type
+ type = name.substring(name.lastIndexOf(".")+1);
if (isCompressedFile(type))
{
@@ -1008,8 +1045,7 @@
} else
{
// check to see if the single file is compressed
- if (isCompressedFile(torrentInfo.getName().substring(
- torrentInfo.getName().length() - 3)))
+ if (isCompressedFile(torrentInfo.getName().substring(torrentInfo.getName().lastIndexOf("."))))
{
TedLog.debug(Lang.getString("TedParser.CompressedFiles"));
return true;
This also means that torrents with multiple files in it will be scanned for matching keywords also.
regards,
gb