Skip to content

Commit

Permalink
releases/1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
zanllp committed Aug 21, 2024
1 parent cb1aa7f commit 14514c9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
8 changes: 5 additions & 3 deletions scripts/iib/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
get_current_commit_hash,
get_current_tag,
get_file_info_by_path,
get_frame_at_second
get_data_file_path
)
from fastapi import FastAPI, HTTPException, Header, Response
from fastapi.staticfiles import StaticFiles
Expand Down Expand Up @@ -73,7 +73,9 @@
except Exception as e:
logger.error(e)

index_html_path = os.path.normpath(os.path.join(__file__, "../","vue/dist/index.html")) if is_exe_ver else os.path.join(cwd, "vue/dist/index.html") # 在app.py也被使用
print(f"data_file_path:{get_data_file_path()}")

index_html_path = get_data_file_path("vue/dist/index.html") if is_exe_ver else os.path.join(cwd, "vue/dist/index.html") # 在app.py也被使用


send_img_path = {"value": ""}
Expand Down Expand Up @@ -746,7 +748,7 @@ def index_bd():
return Response(content=content, media_type="text/html")
return FileResponse(index_html_path)

static_dir = os.path.normpath(os.path.join(__file__, "../","vue/dist")) if is_exe_ver else f"{cwd}/vue/dist"
static_dir = get_data_file_path("vue/dist") if is_exe_ver else f"{cwd}/vue/dist"
@app.get(api_base + "/fe-static/{file_path:path}")
async def serve_static_file(file_path: str):
file_full_path = f"{static_dir}/{file_path}"
Expand Down
12 changes: 11 additions & 1 deletion scripts/iib/tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -723,4 +723,14 @@ def get_frame_at_second(video_path, second):

container.seek(frame_container_pts, backward=True, stream=container.streams.video[0])
frame = next(container.decode(video=0))
return frame
return frame

def get_data_file_path(filename):
if hasattr(sys, '_MEIPASS'):
# Running in a PyInstaller bundle
base_path = os.path.join(sys._MEIPASS)
else:
# Running in a normal Python environment
base_path = os.path.join(os.path.dirname(__file__))

return os.path.normpath(os.path.join(base_path, filename))
2 changes: 1 addition & 1 deletion vue/src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"package": {
"productName": "Infinite Image Browsing",
"version": "1.0.0"
"version": "1.1.0"
},
"tauri": {
"allowlist": {
Expand Down

0 comments on commit 14514c9

Please sign in to comment.