@@ -60,6 +60,22 @@ export interface HydrusTagService {
60
60
display_tags : StatusesToTags ;
61
61
}
62
62
63
+ export enum UrlType {
64
+ Post = 0 ,
65
+ File = 2 ,
66
+ Gallery = 3 ,
67
+ Watchable = 4 ,
68
+ Unknown = 5 ,
69
+ }
70
+
71
+ export interface HydrusNotes {
72
+ [ name : string ] : string ;
73
+ }
74
+
75
+ interface RatingsFromAPI {
76
+ [ service_key : string ] : boolean | number | null ;
77
+ }
78
+
63
79
export interface HydrusFileFromAPI {
64
80
file_id : number ;
65
81
hash : string ;
@@ -68,37 +84,58 @@ export interface HydrusFileFromAPI {
68
84
ext : string ;
69
85
width : number ;
70
86
height : number ;
87
+ duration ?: number ;
71
88
has_audio : boolean ;
89
+ num_frames ?: number ;
90
+ num_words ?: number ;
91
+
92
+ // TODO: make non-optional when v540 is minimum
93
+ filetype_human ?: string ; // added in v540
94
+ filetype_enum ?: number ; //added in v540
95
+ blurhash ?: string ; // added in v545
96
+
72
97
known_urls : string [ ] ;
73
- detailed_known_urls ?: DetailedKnownUrl [ ] ;
74
- duration ?: number | null ;
75
- num_frames ?: number | null ;
76
- num_words ?: number | null ;
77
98
file_services : {
78
99
current ?: FileFileServices ;
79
100
deleted ?: FileFileServices ;
80
101
} ;
81
102
time_modified : number ;
82
-
83
- // removed in hydrus 514
84
- service_names_to_statuses_to_tags ?: ServiceNamesToStatusesToTags ;
85
- service_names_to_statuses_to_display_tags ?: ServiceNamesToStatusesToTags ;
86
-
103
+ service_names_to_statuses_to_tags ?: ServiceNamesToStatusesToTags ; // removed in v514
104
+ service_names_to_statuses_to_display_tags ?: ServiceNamesToStatusesToTags ; // removed in v514
87
105
service_keys_to_statuses_to_tags ?: ServiceNamesToStatusesToTags ;
88
106
service_keys_to_statuses_to_display_tags ?: ServiceNamesToStatusesToTags ;
89
-
90
- tags : {
91
- [ serviceKey : string ] : HydrusTagService ;
92
- } ;
93
-
94
107
is_inbox : boolean ;
95
108
is_local : boolean ;
96
109
is_trashed : boolean ;
97
- notes : {
98
- [ name : string ] : string ;
110
+
111
+ notes ?: HydrusNotes ;
112
+
113
+ // added in v506
114
+ // all known tags added in v507
115
+ tags : {
116
+ [ serviceKey : string ] : HydrusTagService
99
117
} ;
118
+
119
+ detailed_known_urls ?: DetailedKnownUrl [ ] ;
120
+
121
+ ipfs_multihashes ?: Record < string , string > ;
122
+
123
+ ratings ?: RatingsFromAPI ;
124
+
125
+ has_exif ?: boolean ; // added in v506
126
+ has_human_readable_embedded_metadata ?: boolean ; // added in v506
127
+ has_icc_profile ?: boolean ; // added in v506
128
+ has_transparency ?: boolean ; // added in v552
129
+
130
+ thumbnail_width ?: number ; // added in v506
131
+ thumbnail_height ?: number ; // added in v506
132
+
133
+ time_modified_details ?: Record < string , number > ; // added in v506
134
+
135
+ is_deleted ?: boolean ; // added in v506
100
136
}
101
137
138
+
102
139
export enum HydrusFileType {
103
140
Image = 0 ,
104
141
Video = 1 ,
@@ -117,14 +154,6 @@ export enum TagStatus {
117
154
Petitioned = 3 ,
118
155
}
119
156
120
- export enum UrlType {
121
- Post = 0 ,
122
- File = 2 ,
123
- Gallery = 3 ,
124
- Watchable = 4 ,
125
- Unknown = 5 ,
126
- }
127
-
128
157
export function type ( mime : string ) : HydrusFileType {
129
158
if (
130
159
[
0 commit comments