-
-
Notifications
You must be signed in to change notification settings - Fork 4
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/credits #7
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Update the db schema to support a marker_type (intro vs credits), and a 'final' field indicating whether the marker goes to the end of the item.
Include extra information for credits distinction to Plex db queries, and add that information to action recording.
Various bugs were introduced when attempting to add credits info to Plex queries. Also adjust tests to include credit info, but nothing really tests it yet.
While the client only ever adds intros/final=0, the endpoints can in- theory add credit markers that are final/not final.
In late 2020 Plex switched their timestamps from datetime strings to epoch timestamps. Follow that by bundling the conversion into the V4 schema upgrade that includes Credits support. Adjust the rest of the pipeline to handle the new time format. Also rework the storage of "user created": * In the marker backup database, add a user_created column instead of postfixing a '*' to the modified date. * In the Plex DB, make the modified timestamp negative instead of the similar '*' postfixing.
In addition to switching the backup action's time format to epoch timestamps, the hacked thumb_url values in the Plex database also need to be updated, as it's not included in Plex's own schema update.
Allow users to set the marker type when doing basic add/edit/delete operations. Also take into account that Plex doesn't care about keeping indexes "properly" sorted by sorting them by the start offset ourselves, not relying on any set order from the server. This change also begins to document places that can/should be updated to not be so strict about index ordering. On top of that, the following smaller adjustments were made to ensure proper support: * Add marker type/final to edit command parameters * Switch index column in the table to marker type, and make it a SELECT when adding/editing. * Ensure Plex queries are sorted by time_offset instead of index. NOTE: It's almost guaranteed that tests are currently broken. I'll need to rethink some things as far as validating proper order goes. Bulk operations have also not been considered yet.
Fix two issues with bulk-add hints: * With 'Fail' action, we didn't catch cases where the new marker completely encompasses an existing marker. Correctly mark them red. * With 'Merge' action, the 'end' column wouldn't show yellow if the existing marker determined the new end bound. Also fix checkBulkAdd/bulkAdd parameters passed to the server.
Allow the user to choose whether to add intro or credits markers in the bulk-add overlay. Additionally, * Fix more error hinting - show the right error when the start is greater than the length of the episode. * If a bulk-added marker ends at or beyond the end of the episode, mark it final.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
feature/credits, V1
Add initial support for 'credits' markers in addition to 'intro'. In this PR, only TV episodes are supported, but movie integration is planned for the final release, likely 2.0.
Summary of major changes (some of which aren't specific to credits support):
marker_type
andfinal
columns to indicate the type of marker (intro/credits), and if it's a credits marker, whether it indicates thefinal
marker that will invoke the PostPlay screen in Plex.taggings
table to use epoch timestamps instead of datetime strings. Follow suit bymodified_at
/created_at
/recorded_at
fields fromdatetime
tointeger
epoch timestamps.user_created
column, which servers the same purpose that appending*
to themodified_at
date used to.taggings
table to adjust hackedthumb_url
timestamps to epoch timestamps, and since we can't add a column and adding*
to an integer doesn't make sense, use a negative value to indicate user created markers.index
does not correlate to it's "position" in the episode (commercial skips probably could have told me that). Use thetime_offset
(start
) instead, and ensure things are sorted client-side. Update variousindex
-based calculations to instead use the already-sorted marker array that various features hold on to.markerType
/final
parameters to relevant actions (add
,edit
, andbulk_add
).Index
column with the marker type. When adding/editing, make it a dropdown to select from the various marker types. If the Ctrl+Shift+E command is invoked (move the end timestamp to the end of the episode), automatically switch the type toCredits
.Note: Tests do not pass. They've been re-worked for some new features, but not everything.