Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
card
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhanglu
card
Commits
feca1def
Commit
feca1def
authored
Dec 12, 2020
by
zhanglu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 帖子宽高
parent
4614cc5c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
7 deletions
+11
-7
video.py
card/views/schemas/video.py
+1
-1
format.py
card/views/tractate/format.py
+4
-2
schemas.py
card/views/tractate/schemas.py
+6
-4
No files found.
card/views/schemas/video.py
View file @
feca1def
...
@@ -12,4 +12,4 @@ class Video(Schema):
...
@@ -12,4 +12,4 @@ class Video(Schema):
video_url
:
str
=
Field
(
...
,
description
=
"视频地址"
)
video_url
:
str
=
Field
(
...
,
description
=
"视频地址"
)
short_video_url
:
str
=
Field
(
...
,
description
=
"视频短视频url"
)
short_video_url
:
str
=
Field
(
...
,
description
=
"视频短视频url"
)
width
:
Optional
[
int
]
=
Field
(
0
,
description
=
"封面图片宽"
)
width
:
Optional
[
int
]
=
Field
(
0
,
description
=
"封面图片宽"
)
heig
th
:
Optional
[
int
]
=
Field
(
0
,
description
=
"封面图片高"
)
heig
ht
:
Optional
[
int
]
=
Field
(
0
,
description
=
"封面图片高"
)
card/views/tractate/format.py
View file @
feca1def
...
@@ -11,7 +11,7 @@ from card.views.utils.html import gm_decode_html
...
@@ -11,7 +11,7 @@ from card.views.utils.html import gm_decode_html
from
card.views.utils.tag
import
feed_tag_v3_show_filter
from
card.views.utils.tag
import
feed_tag_v3_show_filter
from
card.libs.protocol
import
gm_protocol
from
card.libs.protocol
import
gm_protocol
from
card.views.utils.format
import
BaseFormat
from
card.views.utils.format
import
BaseFormat
from
.schemas
import
Image
,
TractateList
,
TractateInfo
from
.schemas
import
Media
,
TractateList
,
TractateInfo
class
TractateFormat
(
BaseFormat
):
class
TractateFormat
(
BaseFormat
):
...
@@ -130,9 +130,11 @@ class TractateFormat(BaseFormat):
...
@@ -130,9 +130,11 @@ class TractateFormat(BaseFormat):
width
=
video
.
get
(
"width"
,
'0'
),
width
=
video
.
get
(
"width"
,
'0'
),
height
=
video
.
get
(
"height"
,
'0'
),
height
=
video
.
get
(
"height"
,
'0'
),
)
)
else
:
tractate
.
video
=
{}
if
images
:
if
images
:
tractate
.
images
=
Image
(
**
images
)
tractate
.
images
=
Media
(
**
images
)
tags_v2
=
self
.
convert_tags
(
info
.
pop
(
"new_tags"
,
[]),
tag_version
=
TAG_VERSION
.
V2
)
tags_v2
=
self
.
convert_tags
(
info
.
pop
(
"new_tags"
,
[]),
tag_version
=
TAG_VERSION
.
V2
)
tags_v3
=
feed_tag_v3_show_filter
(
info
.
pop
(
"tags_v3"
,
[]))
tags_v3
=
feed_tag_v3_show_filter
(
info
.
pop
(
"tags_v3"
,
[]))
...
...
card/views/tractate/schemas.py
View file @
feca1def
...
@@ -3,7 +3,7 @@ from typing import List, Optional
...
@@ -3,7 +3,7 @@ from typing import List, Optional
from
fastapi_rpcd.all
import
Schema
from
fastapi_rpcd.all
import
Schema
from
pydantic
import
Field
from
pydantic
import
Field
from
card.views.schemas
import
User
,
Tag
,
Video
from
card.views.schemas
import
User
,
Tag
class
TractateListRequest
(
Schema
):
class
TractateListRequest
(
Schema
):
...
@@ -14,8 +14,10 @@ class TractateListRequest(Schema):
...
@@ -14,8 +14,10 @@ class TractateListRequest(Schema):
device_id
:
Optional
[
str
]
=
Field
(
''
,
description
=
"设备ID"
)
device_id
:
Optional
[
str
]
=
Field
(
''
,
description
=
"设备ID"
)
class
Image
(
Schema
):
class
Media
(
Schema
):
video_cover_url
:
str
=
Field
(
''
,
description
=
"video_cover_url"
)
short_video_url
:
str
=
Field
(
''
,
description
=
"short_video_url"
)
image_webp
:
str
=
Field
(
''
,
description
=
"webp图片地址"
)
image_webp
:
str
=
Field
(
''
,
description
=
"webp图片地址"
)
height
:
int
=
Field
(
0
,
description
=
"图片地址"
)
height
:
int
=
Field
(
0
,
description
=
"图片地址"
)
width
:
int
=
Field
(
0
,
description
=
"图片地址"
)
width
:
int
=
Field
(
0
,
description
=
"图片地址"
)
...
@@ -34,8 +36,8 @@ class TractateInfo(Schema):
...
@@ -34,8 +36,8 @@ class TractateInfo(Schema):
gm_url
:
str
=
Field
(
None
,
description
=
"跳转协议"
)
gm_url
:
str
=
Field
(
None
,
description
=
"跳转协议"
)
tags
:
Optional
[
List
[
Tag
]]
=
Field
([],
description
=
"标签"
)
tags
:
Optional
[
List
[
Tag
]]
=
Field
([],
description
=
"标签"
)
user
:
User
=
Field
(
...
,
description
=
"用户信息"
)
user
:
User
=
Field
(
...
,
description
=
"用户信息"
)
images
:
Optional
[
Image
]
=
Field
({},
description
=
"图片"
)
images
:
Optional
[
Media
]
=
Field
({},
description
=
"图片"
)
video
:
Optional
[
Video
]
=
Field
({},
description
=
"视频"
)
video
:
Optional
[
Media
]
=
Field
({},
description
=
"视频"
)
set_cover
:
bool
=
Field
(
False
,
description
=
"是否设置封面"
)
set_cover
:
bool
=
Field
(
False
,
description
=
"是否设置封面"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment