-
Notifications
You must be signed in to change notification settings - Fork 278
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
Feature/show sub original release #7955
Conversation
This was already prepared for another PR, where it will be used by the snatch-selection (vue) component and the history (vue) component. For this addition to the subtitle-search.vue component. Only one of the actions in history.js is used.
…rch.vue manual search table (if available)
…ow-sub-original-release
d = {} | ||
d['id'] = item['rowid'] | ||
|
||
if item['indexer_id'] and item['showid']: |
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.
Can these really be missing?
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.
For an episode it can't.
But i've been overthinking the decistion to create the episode_history.py route. (apiv2/history/tvdb12345/episode/s01e01
). But maybe I should just use a parameter to specify an episode?
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.
I think it's consistent with the rest of the routes. But since they can't be missing for episode, we should raise an exception or leave the check out completely?
|
||
yield d | ||
|
||
if not len(results): |
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.
I don't think len() is needed here
medusa/server/api/v2/history.py
Outdated
d['id'] = item['rowid'] | ||
|
||
if item['indexer_id'] and item['showid']: | ||
d['series'] = SeriesIdentifier.from_id(item['indexer_id'], item['showid']).slug |
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.
same as above
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.
Here it's required. As for example for the history.mako page, we just want to get all history information.
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.
But still indexer_id and showid must be in the DB?
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.
ow yeah good point
medusa/server/api/v2/history.py
Outdated
|
||
yield d | ||
|
||
if not len(results): |
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.
same as above
medusa/server/api/v2/history.py
Outdated
|
||
def data_generator(): | ||
"""Read log lines based on the specified criteria.""" | ||
start = arg_limit * (arg_page - 1) + 1 |
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.
If you remove the +1 here you can remove the two -1 below
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.
Hmm, not sure. For ex. Page 1, with a Limit of 50. Will result in 1, page 2 will result in 51
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.
I've changed it for now.
It's not used anywhere right now. So I'll leave it at that.
When i'm picking up the vueify history page, i'll test it out.
medusa/server/api/v2/history.py
Outdated
"""Read log lines based on the specified criteria.""" | ||
start = arg_limit * (arg_page - 1) + 1 | ||
|
||
for item in results[start - 1:start - 1 + arg_limit]: |
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.
What if there are less results than limit? Possible list index out of range?
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.
I don't think that's possible, as it's slicing the results
* Fixed jest tests * Updated jest snapshot
…l-release' into feature/show-sub-original-release
x-request: | ||
path-params: | ||
seriesid: tvdb999999999 | ||
x-disabled: true |
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.
As requested by @ratoaq2
Reminders