1
1
package quark
2
2
3
3
import (
4
+ "github.com/OpenListTeam/OpenList/pkg/utils"
4
5
"time"
5
6
6
7
"github.com/OpenListTeam/OpenList/internal/model"
@@ -14,26 +15,28 @@ type Resp struct {
14
15
//Timestamp int `json:"timestamp"`
15
16
}
16
17
18
+ var _ model.Obj = (* File )(nil )
19
+
17
20
type File struct {
18
21
Fid string `json:"fid"`
19
22
FileName string `json:"file_name"`
20
23
//PdirFid string `json:"pdir_fid"`
21
- // Category int `json:"category"`
24
+ Category int `json:"category"`
22
25
//FileType int `json:"file_type"`
23
26
Size int64 `json:"size"`
24
27
//FormatType string `json:"format_type"`
25
28
//Status int `json:"status"`
26
29
//Tags string `json:"tags,omitempty"`
27
- // LCreatedAt int64 `json:"l_created_at"`
30
+ LCreatedAt int64 `json:"l_created_at"`
28
31
LUpdatedAt int64 `json:"l_updated_at"`
29
32
//NameSpace int `json:"name_space"`
30
33
//IncludeItems int `json:"include_items,omitempty"`
31
34
//RiskType int `json:"risk_type"`
32
35
//BackupSign int `json:"backup_sign"`
33
36
//Duration int `json:"duration"`
34
37
//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"`
37
40
UpdatedAt int64 `json:"updated_at"`
38
41
//PrivateExtra struct {} `json:"_private_extra"`
39
42
//ObjCategory string `json:"obj_category,omitempty"`
@@ -46,10 +49,43 @@ func fileToObj(f File) *model.Object {
46
49
Name : f .FileName ,
47
50
Size : f .Size ,
48
51
Modified : time .UnixMilli (f .UpdatedAt ),
52
+ Ctime : time .UnixMilli (f .CreatedAt ),
49
53
IsFolder : ! f .File ,
50
54
}
51
55
}
52
56
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
+
53
89
type SortResp struct {
54
90
Resp
55
91
Data struct {
@@ -100,6 +136,82 @@ type DownResp struct {
100
136
//} `json:"metadata"`
101
137
}
102
138
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
+
103
215
type UpPreResp struct {
104
216
Resp
105
217
Data struct {
0 commit comments