Skip to content

Commit

Permalink
Merge pull request #24 from 31December99/search-torrent
Browse files Browse the repository at this point in the history
Fixes for the search torrent command and the utility class
  • Loading branch information
31December99 authored Aug 18, 2024
2 parents 4b13c16 + 4ef9cb2 commit 826da14
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion start.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def main():
torrent_info = View()

if cli.args.search:
torrent_info.search(cli.args.search)
torrent_info.view_search(cli.args.search)
return

if cli.args.info:
Expand Down
4 changes: 2 additions & 2 deletions unit3dup/duplicate.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ def __init__(self, raw_data: dict, season: int, episode: int):
self.raw_data = raw_data
self.season = season
self.episode = episode
self.torrent_info = Torrent()

def video(self) -> bool:
for data in self.raw_data['data']:
Expand Down Expand Up @@ -108,6 +107,7 @@ def process(self, tmdb_id: str) -> bool:
def search(self) -> bool:
tracker_data = self.torrent_info.search(self.guess_filename.guessit_title)
already_present = False
console.log("checking for duplicate entries....")
for t_data in tracker_data['data']:
already_present = self._view_data(t_data)
if already_present:
Expand All @@ -132,7 +132,7 @@ def _view_data(self, data: dict) -> bool:
tracker_file_name = title.Guessit(name)
already = self.compare(tracker_file=tracker_file_name, content_file=self.guess_filename)
if already:
console.log(f"** Tracker has found this media ** -> [{tmdb_id}] [{size}] '{name}' '{poster}'")
console.log(f"[{tmdb_id}] [{size}] '{name}' '{poster}'")
self.flag_already = True
# At least one media needs to match the tracker database
return self.flag_already
Expand Down
2 changes: 1 addition & 1 deletion unit3dup/utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,6 @@ def get_cover(file_name: str):

@staticmethod
def fuzzyit(str1: str, str2: str) -> int:
return fuzz.ratio(str1, str2)
return fuzz.ratio(str1.lower(), str2.lower())


0 comments on commit 826da14

Please sign in to comment.