Skip to content

Commit

Permalink
Simplify stripping uuid directory from filename
Browse files Browse the repository at this point in the history
  • Loading branch information
tw4l committed Jan 30, 2025
1 parent 719503e commit fc3ccbc
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions backend/btrixcloud/pages.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""crawl pages"""

import asyncio
import os
import traceback
from datetime import datetime
from typing import TYPE_CHECKING, Optional, Tuple, List, Dict, Any, Union
Expand Down Expand Up @@ -110,11 +111,7 @@ async def add_crawl_wacz_filename_to_pages(self, crawl_id: str):

for wacz_file in crawl.resources:
# Strip oid directory from filename
filename = wacz_file.name
name_parts = wacz_file.name.split("/")
if name_parts and len(name_parts) > 1:
filename = name_parts[-1]

filename = os.path.basename(wacz_file.name)
page_ids_to_update = []

stream = await self.storage_ops.sync_stream_wacz_pages([wacz_file])
Expand Down

0 comments on commit fc3ccbc

Please sign in to comment.