11package quark
22
33import (
4+ "github.com/OpenListTeam/OpenList/pkg/utils"
45 "time"
56
67 "github.com/OpenListTeam/OpenList/internal/model"
@@ -14,26 +15,28 @@ type Resp struct {
1415 //Timestamp int `json:"timestamp"`
1516}
1617
18+ var _ model.Obj = (* File )(nil )
19+
1720type File struct {
1821 Fid string `json:"fid"`
1922 FileName string `json:"file_name"`
2023 //PdirFid string `json:"pdir_fid"`
21- // Category int `json:"category"`
24+ Category int `json:"category"`
2225 //FileType int `json:"file_type"`
2326 Size int64 `json:"size"`
2427 //FormatType string `json:"format_type"`
2528 //Status int `json:"status"`
2629 //Tags string `json:"tags,omitempty"`
27- // LCreatedAt int64 `json:"l_created_at"`
30+ LCreatedAt int64 `json:"l_created_at"`
2831 LUpdatedAt int64 `json:"l_updated_at"`
2932 //NameSpace int `json:"name_space"`
3033 //IncludeItems int `json:"include_items,omitempty"`
3134 //RiskType int `json:"risk_type"`
3235 //BackupSign int `json:"backup_sign"`
3336 //Duration int `json:"duration"`
3437 //FileSource string `json:"file_source"`
35- File bool `json:"file"`
36- // CreatedAt int64 `json:"created_at"`
38+ File bool `json:"file"`
39+ CreatedAt int64 `json:"created_at"`
3740 UpdatedAt int64 `json:"updated_at"`
3841 //PrivateExtra struct {} `json:"_private_extra"`
3942 //ObjCategory string `json:"obj_category,omitempty"`
@@ -46,10 +49,43 @@ func fileToObj(f File) *model.Object {
4649 Name : f .FileName ,
4750 Size : f .Size ,
4851 Modified : time .UnixMilli (f .UpdatedAt ),
52+ Ctime : time .UnixMilli (f .CreatedAt ),
4953 IsFolder : ! f .File ,
5054 }
5155}
5256
57+ func (f * File ) GetSize () int64 {
58+ return f .Size
59+ }
60+
61+ func (f * File ) GetName () string {
62+ return f .FileName
63+ }
64+
65+ func (f * File ) ModTime () time.Time {
66+ return time .UnixMilli (f .UpdatedAt )
67+ }
68+
69+ func (f * File ) CreateTime () time.Time {
70+ return time .UnixMilli (f .CreatedAt )
71+ }
72+
73+ func (f * File ) IsDir () bool {
74+ return ! f .File
75+ }
76+
77+ func (f * File ) GetHash () utils.HashInfo {
78+ return utils.HashInfo {}
79+ }
80+
81+ func (f * File ) GetID () string {
82+ return f .Fid
83+ }
84+
85+ func (f * File ) GetPath () string {
86+ return ""
87+ }
88+
5389type SortResp struct {
5490 Resp
5591 Data struct {
@@ -100,6 +136,82 @@ type DownResp struct {
100136 //} `json:"metadata"`
101137}
102138
139+ type TranscodingResp struct {
140+ Resp
141+ Data struct {
142+ DefaultResolution string `json:"default_resolution"`
143+ OriginDefaultResolution string `json:"origin_default_resolution"`
144+ VideoList []struct {
145+ Resolution string `json:"resolution"`
146+ VideoInfo struct {
147+ Duration int `json:"duration"`
148+ Size int64 `json:"size"`
149+ Format string `json:"format"`
150+ Width int `json:"width"`
151+ Height int `json:"height"`
152+ Bitrate float64 `json:"bitrate"`
153+ Codec string `json:"codec"`
154+ Fps float64 `json:"fps"`
155+ Rotate int `json:"rotate"`
156+ Audio struct {
157+ Duration int `json:"duration"`
158+ Bitrate float64 `json:"bitrate"`
159+ Codec string `json:"codec"`
160+ Channels int `json:"channels"`
161+ } `json:"audio"`
162+ UpdateTime int `json:"update_time"`
163+ URL string `json:"url"`
164+ Resolution string `json:"resolution"`
165+ HlsType string `json:"hls_type"`
166+ Finish bool `json:"finish"`
167+ Resoultion string `json:"resoultion"`
168+ Success bool `json:"success"`
169+ } `json:"video_info,omitempty"`
170+ //Right string `json:"right"`
171+ //MemberRight string `json:"member_right"`
172+ //TransStatus string `json:"trans_status"`
173+ //Accessable bool `json:"accessable"`
174+ //SupportsFormat string `json:"supports_format"`
175+ //VideoFuncType string `json:"video_func_type,omitempty"`
176+ } `json:"video_list"`
177+ //AudioList []interface{} `json:"audio_list"`
178+ FileName string `json:"file_name"`
179+ NameSpace int `json:"name_space"`
180+ Size int64 `json:"size"`
181+ Thumbnail string `json:"thumbnail"`
182+ //LastPlayInfo struct {
183+ // Time int `json:"time"`
184+ //} `json:"last_play_info"`
185+ //SeekPreviewData struct {
186+ // TotalFrameCount int `json:"total_frame_count"`
187+ // TotalSpriteCount int `json:"total_sprite_count"`
188+ // FrameWidth int `json:"frame_width"`
189+ // FrameHeight int `json:"frame_height"`
190+ // SpriteRow int `json:"sprite_row"`
191+ // SpriteColumn int `json:"sprite_column"`
192+ // PreviewSpriteInfos []struct {
193+ // URL string `json:"url"`
194+ // FrameCount int `json:"frame_count"`
195+ // Times []int `json:"times"`
196+ // } `json:"preview_sprite_infos"`
197+ //} `json:"seek_preview_data"`
198+ //ObjKey string `json:"obj_key"`
199+ //Meta struct {
200+ // Duration int `json:"duration"`
201+ // Size int64 `json:"size"`
202+ // Format string `json:"format"`
203+ // Width int `json:"width"`
204+ // Height int `json:"height"`
205+ // Bitrate float64 `json:"bitrate"`
206+ // Codec string `json:"codec"`
207+ // Fps float64 `json:"fps"`
208+ // Rotate int `json:"rotate"`
209+ //} `json:"meta"`
210+ //PreloadLevel int `json:"preload_level"`
211+ //HasSeekPreviewData bool `json:"has_seek_preview_data"`
212+ } `json:"data"`
213+ }
214+
103215type UpPreResp struct {
104216 Resp
105217 Data struct {
0 commit comments