Biggest thing here is adding the ability to scrobble until the video is 95% done and then not scrobble the same video file again for 15 minutes. This seems hacky, but in practice works pretty well, so long as you don't monkey around with the 95% completion thing. Unlike music, videos are generally watched all the way through.
16 lines
499 B
Python
16 lines
499 B
Python
from rest_framework.negotiation import BaseContentNegotiation
|
|
|
|
|
|
class IgnoreClientContentNegotiation(BaseContentNegotiation):
|
|
def select_parser(self, request, parsers):
|
|
"""
|
|
Select the first parser in the `.parser_classes` list.
|
|
"""
|
|
return parsers[0]
|
|
|
|
def select_renderer(self, request, renderers, format_suffix):
|
|
"""
|
|
Select the first renderer in the `.renderer_classes` list.
|
|
"""
|
|
return (renderers[0], renderers[0].media_type)
|