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

Serialize work type ID #165

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open

Serialize work type ID #165

wants to merge 2 commits into from

Conversation

odrling
Copy link
Contributor

@odrling odrling commented Jul 23, 2024

Serialize the ID of work types to be able to use the /api/library/work-types/{id} route, otherwise the ID has to be guessed.

Found while trying to implement feeding in Japan7/karaberus#38

Serialize the ID of work types to be able to use the
`/api/library/work-types/{id}` route, otherwise the ID has to be guessed.

Found while trying to implement feeding in Japan7/karaberus#38
Copy link

codecov bot commented Jul 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.69%. Comparing base (7b916ae) to head (811c57d).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #165   +/-   ##
========================================
  Coverage    98.69%   98.69%           
========================================
  Files           73       73           
  Lines         1836     1836           
========================================
  Hits          1812     1812           
  Misses          24       24           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

odrling added a commit to Japan7/karaberus that referenced this pull request Jul 25, 2024
Feed tags/medias/artists/karas to dakara on upload and on startup.
Define tag colors (hue) so we can set colors in karaberus and have it
change in dakara at the same time.

Could be obviously improved by checking locally for changes of karaokes,
medias and artists instead of just PUTing everything on sync. Probably
not worth it implement that for tags. We can't yet update work types
decently because dakara doesn't return their IDs.
(DakaraProject/dakara-server#165)

This assumes that video files will all be called `{id}.mkv`, so the
downloader will have to follow this naming scheme to work with dakara.
The files are not all matroska files, but it should not be a problem in
practice.

#40
odrling added a commit to Japan7/karaberus that referenced this pull request Jul 25, 2024
Feed tags/medias/artists/karas to dakara on upload and on startup.
Define tag colors (hue) so we can set colors in karaberus and have it
change in dakara at the same time.

Could be obviously improved by checking locally for changes of karaokes,
medias and artists instead of just PUTing everything on sync. Probably
not worth it implement that for tags. We can't yet update work types
decently because dakara doesn't return their IDs.
(DakaraProject/dakara-server#165)

This assumes that video files will all be called `{id}.mkv`, so the
downloader will have to follow this naming scheme to work with dakara.
The files are not all matroska files, but it should not be a problem in
practice.

#40
@Neraste
Copy link
Member

Neraste commented Jul 28, 2024

Please update test helper here.

@odrling
Copy link
Contributor Author

odrling commented Jul 28, 2024

I can't seem to get the tests to pass, id doesn't seem to be defined on WorkType and I couldn't understand why.

@Neraste
Copy link
Member

Neraste commented Jul 29, 2024

Ah, the helper is also used to assert work type obtained by other serializers (namely, WorkTypeForWorkSerializer) that don't include the ID. So either you check for the ID in the appropriate tests, or you tweak the helper to check the ID only when needed (the former would be simpler).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants