plexflow 0.0.82__py3-none-any.whl → 0.0.84__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -49,11 +49,17 @@ def rank_candidates(candidates: List[DownloadCandidate]):
49
49
 
50
50
  rank = rank_candidate(seeds, size)
51
51
 
52
- # TODO: support native subtitles
53
- if candidate.has_dutch_subtitles:
52
+ if candidate.has_native_dutch_subtitles:
53
+ # native dutch
54
+ ranked.append_native(candidate=candidate, rank=rank, language='nl')
55
+ elif candidate.has_native_english_subtitles:
56
+ # native english
57
+ ranked.append_native(candidate=candidate, rank=rank, language='en')
58
+ elif candidate.has_dutch_subtitles:
54
59
  # encoder dutch
55
60
  ranked.append_encoder(candidate=candidate, rank=rank, language='nl')
56
61
  elif candidate.has_english_subtitles:
62
+ # encoder english
57
63
  ranked.append_encoder(candidate=candidate, rank=rank, language='en')
58
64
  else:
59
65
  ranked.append_nosub(candidate=candidate, rank=rank)
@@ -11,7 +11,7 @@ class TorrentReport:
11
11
  self._extracted_imdb_code = kwargs.get("extracted_imdb_code")
12
12
  self.hardcoded = kwargs.get("hardcoded")
13
13
  self.korsub = kwargs.get("korsub")
14
- self._subtitles = kwargs.get("subtitles")
14
+ self._subtitles = list(filter(lambda s: s, map(lambda s: s.lower().strip(), kwargs.get("subtitles", []))))
15
15
 
16
16
  @property
17
17
  def torrent(self) -> Torrent:
@@ -44,6 +44,14 @@ class TorrentReport:
44
44
  def subtitles(self) -> list:
45
45
  return self._subtitles
46
46
 
47
+ @property
48
+ def has_native_dutch_subtitles(self):
49
+ return 'dutch' in self.subtitles or 'dut' in self.subtitles
50
+
51
+ @property
52
+ def has_native_english_subtitles(self):
53
+ return 'english' in self.subtitles or 'eng' in self.subtitles
54
+
47
55
  @property
48
56
  def source(self) -> str:
49
57
  return self.torrent.source
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: plexflow
3
- Version: 0.0.82
3
+ Version: 0.0.84
4
4
  Summary: A short description of the package.
5
5
  License: MIT
6
6
  Keywords: keyword1,keyword2,keyword3
@@ -69,7 +69,7 @@ plexflow/core/downloads/candidates/download_candidate.py,sha256=KlW4GhAbp2hhDuoA
69
69
  plexflow/core/downloads/candidates/filtered.py,sha256=HgUY0S3aWAeHASHTjND9hyjCtGNLhUzLOL90G2CDxKg,1842
70
70
  plexflow/core/downloads/candidates/rank/__pycache__/ranking.cpython-312.pyc,sha256=Wz8hGAtLZNT0ThAPwloLBek5wflI6DKFDhr5_b7TzPI,4045
71
71
  plexflow/core/downloads/candidates/rank/__pycache__/utils.cpython-312.pyc,sha256=5Q6q1kw62WCWlPVFpXgXYt6oqf2gWHK_DHaZ-CBADwk,426
72
- plexflow/core/downloads/candidates/rank/ranking.py,sha256=NJPpNxZ1z-VT5LkDCaamV0Zqj4IKlbkrZwEojMOI0lc,2181
72
+ plexflow/core/downloads/candidates/rank/ranking.py,sha256=p86f3DQmXJNE53gPk9E5RcKA7dgXI4wPQsIh9ae1uxY,2490
73
73
  plexflow/core/downloads/candidates/rank/utils.py,sha256=R4Ai4KmZRONo9vd2rf32DdGxVkANHYFwSjrO5WVjX9U,100
74
74
  plexflow/core/downloads/candidates/utils.py,sha256=ahI6bvk7CHT_O0BEXsd7FtC180Swlt9Phj6_op1mhYA,1777
75
75
  plexflow/core/env/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -646,7 +646,7 @@ plexflow/utils/torrent/__pycache__/analyze.cpython-312.pyc,sha256=bkmS6HF05DdGSu
646
646
  plexflow/utils/torrent/__pycache__/files.cpython-312.pyc,sha256=s0TsS5xH_R1iit2PseyDlLspXwt37Ll_PN932l4fBQo,3930
647
647
  plexflow/utils/torrent/__pycache__/hash.cpython-311.pyc,sha256=RDp8Sv5NLkUw0r6w6JD8rOH1ksN3NnTv4DzhZuZBouA,2284
648
648
  plexflow/utils/torrent/__pycache__/hash.cpython-312.pyc,sha256=jlbSscMzvGQkHDBP-zB3JB8DMRenvzSRIiOKprFhYQQ,3631
649
- plexflow/utils/torrent/analyze.py,sha256=Yjv-Qsrkrq33ZSmDFkXkyutnNcW7fkGcls-IOB5ELvs,4579
649
+ plexflow/utils/torrent/analyze.py,sha256=4f71sz1JZSgOAFdJY31dHomFNCUPlyxft7P3ffrWroU,4902
650
650
  plexflow/utils/torrent/extract/__pycache__/common.cpython-312.pyc,sha256=WTgyNFyySpFEtklNMsrhdvngA_ap8AAY-5-QPHVtxfM,1862
651
651
  plexflow/utils/torrent/extract/__pycache__/ext.cpython-312.pyc,sha256=qRVyjKJFb5P5wGETuI05oqUxUaKvNMzBpk8jB7sHk1E,272185
652
652
  plexflow/utils/torrent/extract/__pycache__/extratorrent.cpython-312.pyc,sha256=a08Mno5zwRLr5VQTzF5OFskW5cHt5kKdhJbxQRqWzF4,3448
@@ -675,7 +675,7 @@ plexflow/utils/video/__pycache__/audio.cpython-312.pyc,sha256=vXBnJwWgTDFdixMBs-
675
675
  plexflow/utils/video/__pycache__/subtitle.cpython-312.pyc,sha256=PCjpCLydGXaRsQy6cikhgsEs8WlComfOoYPiLFqfVMA,2515
676
676
  plexflow/utils/video/audio.py,sha256=tJ_lNwcjVuBQYD5cYOlXpr__eh8-hnReIgNRgIYOpqo,3380
677
677
  plexflow/utils/video/subtitle.py,sha256=LOGONGxs_RzmqtGP-DBKreOzS1eUFEKo75Q6AfnavW0,1290
678
- plexflow-0.0.82.dist-info/METADATA,sha256=p43KOXmcp-N8e8CTqksho8gjNBv5EmF7Hbz2HAda4WU,2954
679
- plexflow-0.0.82.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
680
- plexflow-0.0.82.dist-info/entry_points.txt,sha256=aEqDHlozu_zjWrl2sibtrqtQHMgU8kSJZrE782CP47g,1362
681
- plexflow-0.0.82.dist-info/RECORD,,
678
+ plexflow-0.0.84.dist-info/METADATA,sha256=yuQCxZ1FFKQgVD95w6kYL88H1P_7GDBdKOFkF3dfIug,2954
679
+ plexflow-0.0.84.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
680
+ plexflow-0.0.84.dist-info/entry_points.txt,sha256=aEqDHlozu_zjWrl2sibtrqtQHMgU8kSJZrE782CP47g,1362
681
+ plexflow-0.0.84.dist-info/RECORD,,