mirror of
https://github.com/StuffAnThings/qbit_manage.git
synced 2025-09-10 23:25:42 +08:00
Revert "Fixes #359"
This commit is contained in:
parent
b0dbbc4dcd
commit
3d230f39a1
7 changed files with 6 additions and 68 deletions
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
4.0.9-develop8
|
||||
4.0.9-develop9
|
||||
|
|
|
@ -3,7 +3,6 @@ from collections import Counter
|
|||
|
||||
from modules import util
|
||||
from modules.torrent_hash_generator import TorrentHashGenerator
|
||||
from modules.util import remove_extension
|
||||
|
||||
logger = util.logger
|
||||
|
||||
|
@ -111,7 +110,7 @@ class CrossSeed:
|
|||
self.notify_attr = []
|
||||
# Tag missing cross-seed torrents tags
|
||||
for torrent in self.qbt.torrent_list:
|
||||
t_name = remove_extension(torrent.name)
|
||||
t_name = torrent.name
|
||||
t_cat = torrent.category
|
||||
if (
|
||||
not util.is_tag_in_torrent(self.cross_seed_tag, torrent.tags)
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
from datetime import timedelta
|
||||
|
||||
from modules import util
|
||||
from modules.util import remove_extension
|
||||
|
||||
logger = util.logger
|
||||
|
||||
|
@ -106,7 +105,7 @@ class ReCheck:
|
|||
# Recheck
|
||||
elif (
|
||||
torrent.progress == 0
|
||||
and self.qbt.torrentinfo[remove_extension(t_name)]["is_complete"]
|
||||
and self.qbt.torrentinfo[t_name]["is_complete"]
|
||||
and not torrent.state_enum.is_checking
|
||||
):
|
||||
self.stats_rechecked += 1
|
||||
|
|
|
@ -4,7 +4,6 @@ from qbittorrentapi import TrackerStatus
|
|||
from modules import util
|
||||
from modules.util import TorrentMessages
|
||||
from modules.util import list_in_text
|
||||
from modules.util import remove_extension
|
||||
|
||||
logger = util.logger
|
||||
|
||||
|
@ -97,7 +96,7 @@ class RemoveUnregistered:
|
|||
self.notify_attr_unreg = [] # List of single torrent attributes to send to notifiarr
|
||||
|
||||
for torrent in self.qbt.torrentissue:
|
||||
self.t_name = remove_extension(torrent.name)
|
||||
self.t_name = torrent.name
|
||||
self.t_cat = self.qbt.torrentinfo[self.t_name]["Category"]
|
||||
self.t_msg = self.qbt.torrentinfo[self.t_name]["msg"]
|
||||
self.t_status = self.qbt.torrentinfo[self.t_name]["status"]
|
||||
|
|
|
@ -4,7 +4,6 @@ from time import time
|
|||
|
||||
from modules import util
|
||||
from modules.util import is_tag_in_torrent
|
||||
from modules.util import remove_extension
|
||||
from modules.webhooks import GROUP_NOTIFICATION_LIMIT
|
||||
|
||||
logger = util.logger
|
||||
|
@ -80,7 +79,7 @@ class ShareLimits:
|
|||
t_deleted_and_contents = set()
|
||||
for torrent_hash, torrent_dict in self.tdel_dict.items():
|
||||
torrent = torrent_dict["torrent"]
|
||||
t_name = remove_extension(torrent.name)
|
||||
t_name = torrent.name
|
||||
t_count = self.qbt.torrentinfo[t_name]["count"]
|
||||
t_msg = self.qbt.torrentinfo[t_name]["msg"]
|
||||
t_status = self.qbt.torrentinfo[t_name]["status"]
|
||||
|
|
|
@ -13,7 +13,6 @@ from modules import util
|
|||
from modules.util import Failed
|
||||
from modules.util import TorrentMessages
|
||||
from modules.util import list_in_text
|
||||
from modules.util import remove_extension
|
||||
|
||||
logger = util.logger
|
||||
|
||||
|
@ -136,7 +135,7 @@ class Qbt:
|
|||
if torrent.auto_tmm is False and settings["force_auto_tmm"] and torrent.category != "" and not self.config.dry_run:
|
||||
torrent.set_auto_management(True)
|
||||
try:
|
||||
torrent_name = remove_extension(torrent.name)
|
||||
torrent_name = torrent.name
|
||||
torrent_hash = torrent.hash
|
||||
torrent_is_complete = torrent.state_enum.is_complete
|
||||
save_path = torrent.save_path
|
||||
|
|
|
@ -14,63 +14,6 @@ import ruamel.yaml
|
|||
logger = logging.getLogger("qBit Manage")
|
||||
|
||||
|
||||
def remove_extension(filename):
|
||||
video_extensions = [
|
||||
".3gp",
|
||||
".3g2",
|
||||
".asf",
|
||||
".avi",
|
||||
".divx",
|
||||
".flv",
|
||||
".m2ts",
|
||||
".m4v",
|
||||
".mkv",
|
||||
".mov",
|
||||
".mp2",
|
||||
".mp4",
|
||||
".mpe",
|
||||
".mpeg",
|
||||
".mpg",
|
||||
".mpv",
|
||||
".mts",
|
||||
".mxf",
|
||||
".ogg",
|
||||
".ogv",
|
||||
".qt",
|
||||
".rm",
|
||||
".rmvb",
|
||||
".ts",
|
||||
".vob",
|
||||
".webm",
|
||||
".wmv",
|
||||
]
|
||||
audio_extensions = [
|
||||
".aac",
|
||||
".aiff",
|
||||
".ape",
|
||||
".au",
|
||||
".flac",
|
||||
".m4a",
|
||||
".m4b",
|
||||
".mka",
|
||||
".mp3",
|
||||
".ogg",
|
||||
".opus",
|
||||
".ra",
|
||||
".rm",
|
||||
".wav",
|
||||
".wma",
|
||||
]
|
||||
all_extensions = video_extensions + audio_extensions
|
||||
# Split the filename into base and extension parts
|
||||
base, extension = os.path.splitext(filename)
|
||||
# If there's an extension, return the base part
|
||||
if extension in all_extensions:
|
||||
return base
|
||||
else:
|
||||
return filename
|
||||
|
||||
|
||||
def get_list(data, lower=False, split=True, int_list=False):
|
||||
"""Return a list from a string or list."""
|
||||
if data is None:
|
||||
|
|
Loading…
Add table
Reference in a new issue