@@ -113,12 +113,24 @@ def _get_internal_urls(self) -> Iterator[DocumentInfo]:
113
113
114
114
url = self .normalize_url (module ["contents" ][0 ]["fileurl" ])
115
115
116
+ modified = (
117
+ datetime .fromtimestamp (module ["contents" ][0 ]["timemodified" ], tz = timezone .utc )
118
+ if module ["contents" ][0 ]["timemodified" ]
119
+ else None
120
+ )
121
+
122
+ created = (
123
+ datetime .fromtimestamp (module ["contents" ][0 ]["timecreated" ], tz = timezone .utc )
124
+ if module ["contents" ][0 ]["timecreated" ]
125
+ else modified
126
+ )
127
+
116
128
yield DocumentInfo (
117
129
url = url ,
118
130
type = self ._get_document_type (url ),
119
131
title = module ["name" ],
120
- created = datetime . fromtimestamp ( module [ "contents" ][ 0 ][ "timecreated" ], tz = timezone . utc ) ,
121
- modified = datetime . fromtimestamp ( module [ "contents" ][ 0 ][ "timemodified" ], tz = timezone . utc ) ,
132
+ created = created ,
133
+ modified = modified ,
122
134
extension = os .path .splitext (urlparse (url ).path )[1 ][1 :],
123
135
)
124
136
@@ -153,12 +165,18 @@ def _get_external_urls(self) -> Iterator[DocumentInfo]:
153
165
154
166
url = self .normalize_url (content ["externalurl" ])
155
167
168
+ modified = (
169
+ datetime .fromtimestamp (content ["timemodified" ], tz = timezone .utc )
170
+ if content ["timemodified" ]
171
+ else None
172
+ )
173
+
156
174
yield DocumentInfo (
157
175
url = url ,
158
176
type = self ._get_document_type (url ),
159
177
title = content ["name" ],
160
- created = datetime . fromtimestamp ( content [ "timemodified" ], tz = timezone . utc ) ,
161
- modified = datetime . fromtimestamp ( content [ "timemodified" ], tz = timezone . utc ) ,
178
+ created = modified ,
179
+ modified = modified ,
162
180
extension = os .path .splitext (urlparse (url ).path )[1 ][1 :],
163
181
)
164
182
@@ -182,6 +200,8 @@ def normalize_url(self, url: str) -> str:
182
200
url .replace (self .config .pluginFileWebserviceUrl , self .config .pluginFileNormalUrl )
183
201
.replace ("?forcedownload=1" , "" )
184
202
.replace ("?dl=0" , "?raw=1" )
203
+ .replace ("&dl=0" , "&raw=1" )
204
+ .replace ("?rlkey=" , "?raw=1&rlkey=" )
185
205
)
186
206
187
207
def tokenize_url (self , url : str ) -> str :
@@ -438,7 +458,7 @@ def _parse_substitutions(self, tables: Tables, effective: date) -> None:
438
458
elif row == header_reservations :
439
459
parser_type = ParserType .RESERVATIONS
440
460
continue
441
- elif "Oddelek" in row [0 ] or "Razred" in row [0 ] or "dijaki" in row [0 ]:
461
+ elif "Oddelek" in row [0 ] or "Razred" in row [0 ] or "dijaki" in row [0 ] or "RAZREDNIK" in row [ 1 ] :
442
462
parser_type = ParserType .UNKNOWN
443
463
continue
444
464
0 commit comments