-
-
Notifications
You must be signed in to change notification settings - Fork 601
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mass refactor tv.py #8706
mass refactor tv.py #8706
Changes from 8 commits
83e529a
a3055a7
e36b6fb
8a67418
89546f4
6989d8c
7ba09ac
0bcd73f
6850259
846aa4a
754e34f
c20da34
ae3e0ff
cb4c31b
2a6deff
4735005
9614388
0ac7c4c
7b58831
18c4a7d
b44dc29
6340a58
212444f
dacdd68
140482a
8e44069
735ea0a
0fb6c6b
bae210c
a6ed3a4
b96ea86
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -404,9 +404,9 @@ | |
(season_number, episode_number) = (default_season, default_episode) | ||
default_episode_numbering = True | ||
|
||
epLoc = epResult["location"] | ||
if epLoc and show._location and epLoc.lower().startswith(show._location.lower()): | ||
epLoc = epLoc[len(show._location)+1:] | ||
episode_location = epResult["location"] | ||
if episode_location and show.get_location and episode_location.lower().startswith(show.get_location.lower()): | ||
episode_location = episode_location[len(show.get_location)+1:] | ||
%> | ||
% if int(epResult["season"]) != curSeason: | ||
% if epResult["season"] != sql_results[0]["season"]: | ||
|
@@ -485,8 +485,8 @@ | |
<td class="text-center episode"> | ||
<% | ||
text = str(epResult['episode']) | ||
if epLoc: | ||
text = '<span title="' + epLoc + '" class="addQTip">' + text + "</span>" | ||
if episode_location: | ||
text = '<span title="' + episode_location + '" class="addQTip">' + text + "</span>" | ||
Comment on lines
+488
to
+489
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The variable |
||
%> | ||
${text} | ||
</td> | ||
|
@@ -523,7 +523,7 @@ | |
% endif | ||
${epResult["name"]} | ||
</td> | ||
<td class="col-name location">${epLoc}</td> | ||
<td class="col-name location">${episode_location}</td> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The display of |
||
<td class="col-ep size"> | ||
% if epResult["file_size"]: | ||
${pretty_file_size(epResult["file_size"])} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -109,7 +109,7 @@ | |
<td class="text-center">${statusStrings[curShow.default_ep_status]}</td> | ||
<td class="text-center">${_(curShow.status)}</td> | ||
|
||
<td class="text-center">${curShow._location.rsplit('\\', 1)[0]}</td> | ||
<td class="text-center">${curShow.get_location.rsplit('\\', 1)[0]}</td> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use of |
||
<td class="text-center"> | ||
<% disabled = settings.showQueueScheduler.action.is_being_updated(curShow) or settings.showQueueScheduler.action.is_in_update_queue(curShow) %> | ||
<label for="update-${curShow.indexerid}" class="sr-only">${_('Update')} ${curShow.name}</label> | ||
|
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -78,14 +78,14 @@ | |||||||
% for current_episode in sorted(show.episodes[current_season], reverse=True): | ||||||||
<% | ||||||||
episode_object = show.episodes[current_season][current_episode] | ||||||||
if not (episode_object and episode_object._location): | ||||||||
if not (episode_object and episode_object.location): | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing error handling for |
||||||||
continue | ||||||||
|
||||||||
episode_list = episode_object.sorted_episode_list | ||||||||
if episode_object.episode != min(episode_list): | ||||||||
continue | ||||||||
|
||||||||
location = episode_object.location[len(show._location)+1:] | ||||||||
location = episode_object.location[len(show.get_location)+1:] | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Potential performance issue: - location = episode_object.location[len(show.get_location)+1:]
+ show_location_length = len(show.get_location)
+ location = episode_object.location[show_location_length+1:] Committable suggestion
Suggested change
|
||||||||
extension = location.split('.')[-1] | ||||||||
new_location = episode_object.proper_path() + '.' + extension | ||||||||
%> | ||||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -76,7 +76,7 @@ def make_result(cls, result_dict): | |||||
return show[0] | ||||||
|
||||||
show = show[1] | ||||||
episode_objects = [show.getEpisode(result_dict.get("season"), ep) for ep in result_dict.get("episodes").split("|") if ep] | ||||||
episode_objects = [show.get_episode(result_dict.get("season"), ep) for ep in result_dict.get("episodes").split("|") if ep] | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Method call - episode_objects = [show.get_episode(result_dict.get("season"), ep) for ep in result_dict.get("episodes").split("|") if ep]
+ episode_objects = [show.getEpisode(result_dict.get("season"), ep) for ep in result_dict.get("episodes").split("|") if ep] Committable suggestion
Suggested change
|
||||||
result = cls(episode_objects) | ||||||
result.from_json(result_dict) | ||||||
result.show = show | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using
cache: 'yarn'
withactions/setup-node@v4
while runningnpm install -g yarn
seems redundant. If Yarn is being used, consider removing thenpm install -g yarn
command or clarify the necessity of this approach.