remove cdn_url check before storage.

pull/189/head
erinhmclark 2025-02-10 18:56:46 +00:00
rodzic e97ccf8a73
commit 3dae2337a1
2 zmienionych plików z 3 dodań i 4 usunięć

Wyświetl plik

@ -65,7 +65,7 @@ class Media:
def is_stored(self, in_storage) -> bool:
# checks if the media is already stored in the given storage
return len(self.urls) > 0 and any([u for u in self.urls if in_storage.get_cdn_url(self) in u])
return len(self.urls) > 0 and len(self.urls) == len(in_storage.config["steps"]["storages"])
def set(self, key: str, value: Any) -> Media:
self.properties[key] = value

Wyświetl plik

@ -68,11 +68,10 @@ class GDriveStorage(Storage):
filename = path_parts[-1]
logger.info(f"looking for folders for {path_parts[0:-1]} before getting url for {filename=}")
for folder in path_parts[0:-1]:
folder_id = self._get_id_from_parent_and_name(parent_id, folder, use_mime_type=True, raise_on_missing=False)
folder_id = self._get_id_from_parent_and_name(parent_id, folder, use_mime_type=True, raise_on_missing=True)
parent_id = folder_id
# get id of file inside folder (or sub folder)
# TODO: supressing the error as being checked before first upload
file_id = self._get_id_from_parent_and_name(folder_id, filename, raise_on_missing=False)
file_id = self._get_id_from_parent_and_name(folder_id, filename, raise_on_missing=True)
if not file_id:
#
logger.info(f"file {filename} not found in folder {folder_id}")