Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit86d0823

Browse files
authored
fix: Use direct URLs for thumbnails in DeoVR API (#1708)
Co-authored-by: crwxaj <crwxaj>
1 parent4bee84e commit86d0823

File tree

1 file changed

+15
-32
lines changed

1 file changed

+15
-32
lines changed

‎pkg/api/deovr.go

Lines changed: 15 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -303,16 +303,15 @@ func (i DeoVRResource) getDeoFile(req *restful.Request, resp *restful.Response)
303303
})
304304

305305
deoScene:=DeoScene{
306-
ID:999900000+file.ID,
307-
Authorized:1,
308-
Description:file.Filename,
309-
Title:file.Filename,
310-
Date:file.CreatedTime.Unix(),
311-
IsFavorite:false,
312-
ThumbnailURL:session.DeoRequestHost+"/ui/images/blank.png",
313-
Is3D:true,
314-
Encodings:sources,
315-
VideoLength:int(file.VideoDuration),
306+
ID:999900000+file.ID,
307+
Authorized:1,
308+
Description:file.Filename,
309+
Title:file.Filename,
310+
Date:file.CreatedTime.Unix(),
311+
IsFavorite:false,
312+
Is3D:true,
313+
Encodings:sources,
314+
VideoLength:int(file.VideoDuration),
316315
}
317316

318317
resp.WriteHeaderAndEntity(http.StatusOK,deoScene)
@@ -498,7 +497,6 @@ func (i DeoVRResource) getDeoScene(req *restful.Request, resp *restful.Response)
498497
}
499498

500499
title:=scene.Title
501-
thumbnailURL:=session.DeoRequestHost+"/img/700x/"+strings.Replace(scene.CoverURL,"://",":/",-1)
502500

503501
// Passthrough
504502
varckdatamap[string]interface{}
@@ -524,13 +522,6 @@ func (i DeoVRResource) getDeoScene(req *restful.Request, resp *restful.Response)
524522
chromaKey=gjson.ParseBytes(ckup)
525523
}
526524

527-
ifscene.IsScripted {
528-
title=scene.GetFunscriptTitle()
529-
ifconfig.Config.Interfaces.DeoVR.RenderHeatmaps {
530-
thumbnailURL=session.DeoRequestHost+"/imghm/"+fmt.Sprint(scene.ID)+"/"+strings.Replace(scene.CoverURL,"://",":/",-1)
531-
}
532-
}
533-
534525
// set date to EPOCH in case it is missing or 0001-01-01
535526
finalDate:=scene.ReleaseDate.Unix()
536527
iffinalDate<0 {
@@ -551,7 +542,7 @@ func (i DeoVRResource) getDeoScene(req *restful.Request, resp *restful.Response)
551542
RatingAvg:scene.StarRating,
552543
FullVideoReady:true,
553544
FullAccess:true,
554-
ThumbnailURL:thumbnailURL,
545+
ThumbnailURL:scene.CoverURL,
555546
StereoMode:stereoMode,
556547
Is3D:true,
557548
ScreenType:screenType,
@@ -583,7 +574,7 @@ func (i DeoVRResource) getDeoScene(req *restful.Request, resp *restful.Response)
583574
RatingAvg:scene.StarRating,
584575
FullVideoReady:true,
585576
FullAccess:true,
586-
ThumbnailURL:thumbnailURL,
577+
ThumbnailURL:scene.CoverURL,
587578
StereoMode:stereoMode,
588579
Is3D:true,
589580
ScreenType:screenType,
@@ -659,17 +650,10 @@ func scenesToDeoList(req *restful.Request, scenes []models.SceneSummary) []DeoLi
659650

660651
list:=make([]DeoListItem,0)
661652
fori:=rangescenes {
662-
varthumbnailURLstring
663-
ifconfig.Config.Interfaces.DeoVR.RenderHeatmaps&&scenes[i].IsScripted {
664-
thumbnailURL=fmt.Sprintf("%v/imghm/%d/%v",session.DeoRequestHost,scenes[i].ID,strings.Replace(scenes[i].CoverURL,"://",":/",-1))
665-
}else {
666-
thumbnailURL=fmt.Sprintf("%v/img/700x/%v",session.DeoRequestHost,strings.Replace(scenes[i].CoverURL,"://",":/",-1))
667-
}
668-
669653
item:=DeoListItem{
670654
Title:scenes[i].Title,
671655
VideoLength:scenes[i].Duration*60,
672-
ThumbnailURL:thumbnailURL,
656+
ThumbnailURL:scenes[i].CoverURL,
673657
VideoURL:fmt.Sprintf("%v/deovr/%v",session.DeoRequestHost,scenes[i].ID),
674658
}
675659
list=append(list,item)
@@ -693,10 +677,9 @@ func filesToDeoList(req *restful.Request, files []models.File) []DeoListItem {
693677
}
694678
}
695679
item:=DeoListItem{
696-
Title:files[i].Filename,
697-
VideoLength:uint(files[i].VideoDuration),
698-
ThumbnailURL:session.DeoRequestHost+"/ui/images/blank.png",
699-
VideoURL:fmt.Sprintf("%v/deovr/file/%v%v",session.DeoRequestHost,files[i].ID,dnt),
680+
Title:files[i].Filename,
681+
VideoLength:uint(files[i].VideoDuration),
682+
VideoURL:fmt.Sprintf("%v/deovr/file/%v%v",session.DeoRequestHost,files[i].ID,dnt),
700683
}
701684
list=append(list,item)
702685
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp