Skip to content
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

Add new field watched to tv_episodes table and Episode class. #4825

Merged
merged 6 commits into from
Aug 10, 2018

Conversation

p0psicles
Copy link
Contributor

@p0psicles p0psicles commented Aug 1, 2018

  • Updated apiv2 to patch the watched field.
  • PR is based on the DEVELOP branch
  • Don't send big changes all at once. Split up big PRs into multiple smaller PRs that are easier to manage and review
  • Read the contribution guide

the idea of this feature, is provide users the ability to keep track of watched / unwatched episodes.
They'll be able to manually set the status from medusa. Or automate it through the medusa kodi addon.

For now this PR will be limited to introducing the watched field. A new PR will be used to make some UI changes. As to update the watched flag manually.

TODO:

  • Add watched field to db migrations
  • Add watched property to Tvepisode class
  • Update apiv2
  • Update CHANGELOG.md

* Updated apiv2 to patch the watched field.
@p0psicles p0psicles added Concluded Migration Database and/or Config migration performed and removed Feature in progress In progress labels Aug 9, 2018
@OmgImAlexis OmgImAlexis requested a review from a team August 10, 2018 10:29
@OmgImAlexis OmgImAlexis added this to the 0.2.9 milestone Aug 10, 2018
'version, release_group, manually_searched, watched) '
'SELECT showid, indexerid, indexer, '
'name, season, episode, description, airdate, hasnfo, '
'hastbn, status, -1 AS quality, location, file_size, release_name, '
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why you are changing the quality fields to -1?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thats a foobar

@@ -699,7 +699,7 @@ def execute(self):
utils.backup_database(self.connection.path, self.connection.version)

log.info(u'Adding new quality field in the tv_episodes table')
self.connection.action('DROP TABLE IF EXISTS old_tv_episodes;')
self.connection.action('DROP TABLE IF EXISTS tmp_tv_episodes;')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this should have been renamed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trying to keep it consistant. Also tmp is a better description then old. As where not dealing with 'old' episodes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that case you should also replace it in the next line.

'FROM tmp_tv_episodes;'
)

self.connection.action('DROP TABLE tmp_tv_episodes')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing semicolon for consistency.

CHANGELOG.md Outdated
@@ -5,6 +5,7 @@
#### Improvements
- Converted /config/postProcessing to a Vue component ([#4259](https://github.com/pymedusa/Medusa/pull/4259))
- Bundled the web application using Webpack ([#4692](https://github.com/pymedusa/Medusa/pull/4692))
- Add watched field to the tv_episodes db table. UI will be added in future. ([#4692](https://github.com/pymedusa/Medusa/pull/4825))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use past tense for consistency.

'hastbn, status, quality, location, file_size, release_name, '
'subtitles, subtitles_searchcount, subtitles_lastsearch, '
'is_proper, scene_season, scene_episode, absolute_number, '
'scene_absolute_number, version, release_group, manually_searched, 0 '
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe 0 AS watched to make it more explicit.

@medariox medariox merged commit ff9b16e into develop Aug 10, 2018
@medariox medariox deleted the feature/add-episode-watched-status branch August 10, 2018 19:21
@fernandog fernandog mentioned this pull request Aug 22, 2018
@sharkykh sharkykh mentioned this pull request Sep 12, 2018
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Concluded Migration Database and/or Config migration performed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants