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

Expose "raw":"1" from the API in MediaList #586

Merged
merged 2 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ class MediaItem(CustomBaseModel):
low_res_video_size: Optional[str] = Field(alias="glrv", default=None) #: Low resolution video size
lrv_file_size: Optional[str] = Field(alias="ls", default=None) #: Low resolution file size
session_id: Optional[str] = Field(alias="id", default=None) # Media list session identifier
raw: Optional[str] = Field(default=None) #: 1 if photo has raw version, 0 (or omitted) otherwise


class GroupedMediaItem(MediaItem):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
"ls": "-1",
"s": "25086075",
},
{"n": "GOPR0039.JPG", "cre": "1724339068", "mod": "1724339068", "raw": "1", "s": "783927"},
],
}
],
Expand All @@ -134,9 +135,10 @@ def test_media_list():
media_list = MediaList(**MEDIA_LIST)
assert media_list
items = media_list.files
assert len(items) == 12
assert len(items) == 13
assert len([item for item in items if isinstance(item, GroupedMediaItem)]) == 2
assert media_list.files[0].filename == "100GOPRO/GX010001.MP4"
assert media_list.files[-1].raw == "1"


VIDEO_METADATA: Final = {
Expand Down