@@ -405,7 +405,7 @@ def refresh(cls, skelValues):
405
405
skelValues ["downloadUrl" ] = importData
406
406
skelValues ["pendingparententry" ] = False
407
407
408
- conf .main_app .file .create_serving_url (skelValues )
408
+ conf .main_app .file .inject_serving_url (skelValues )
409
409
410
410
411
411
class FileNodeSkel (TreeSkel ):
@@ -508,7 +508,7 @@ def create_internal_serving_url(
508
508
This is needed to hide requests to Google as they are internally be routed, and can be the result of a
509
509
legal requirement like GDPR.
510
510
511
- :param serving_url: Is the original serving URL as generated from create_serving_url ()
511
+ :param serving_url: Is the original serving URL as generated from inject_serving_url ()
512
512
:param size: Optional size setting
513
513
:param filename: Optonal filename setting
514
514
:param options: Additional options parameter-pass through to /file/serve
@@ -1139,8 +1139,7 @@ def add(self, skelType: SkelType, node: db.Key | int | str | None = None, *args,
1139
1139
skel ["weak" ] = rootNode is None
1140
1140
skel ["crc32c_checksum" ] = base64 .b64decode (blob .crc32c ).hex ()
1141
1141
skel ["md5_checksum" ] = base64 .b64decode (blob .md5_hash ).hex ()
1142
-
1143
- skel = self .create_serving_url (skel )
1142
+ self .inject_serving_url (skel )
1144
1143
1145
1144
skel .toDB ()
1146
1145
@@ -1172,7 +1171,7 @@ def onEdit(self, skelType: SkelType, skel: SkeletonInstance):
1172
1171
bucket .copy_blob (old_blob , bucket , new_path , if_generation_match = 0 )
1173
1172
bucket .delete_blob (old_path )
1174
1173
1175
- self .create_serving_url (skel )
1174
+ self .inject_serving_url (skel )
1176
1175
1177
1176
def mark_for_deletion (self , dlkey : str ) -> None :
1178
1177
"""
@@ -1196,9 +1195,8 @@ def mark_for_deletion(self, dlkey: str) -> None:
1196
1195
1197
1196
db .Put (fileObj )
1198
1197
1199
- def create_serving_url (self , skel : SkeletonInstance ) -> SkeletonInstance :
1200
- """ Create Serving url for public image files
1201
- """
1198
+ def inject_serving_url (self , skel : SkeletonInstance ) -> None :
1199
+ """Inject the serving url for public image files into a FileSkel"""
1202
1200
# try to create a servingurl for images
1203
1201
if not conf .instance .is_dev_server and skel ["public" ] and skel ["mimetype" ] \
1204
1202
and skel ["mimetype" ].startswith ("image/" ) and not skel ["serving_url" ]:
@@ -1214,8 +1212,6 @@ def create_serving_url(self, skel: SkeletonInstance) -> SkeletonInstance:
1214
1212
logging .warning ("Error while creating serving url" )
1215
1213
logging .exception (e )
1216
1214
1217
- return skel
1218
-
1219
1215
1220
1216
@PeriodicTask (interval = datetime .timedelta (hours = 4 ))
1221
1217
def startCheckForUnreferencedBlobs ():
0 commit comments