Skip to content
This repository has been archived by the owner on Dec 9, 2024. It is now read-only.

Fix: Access localhost webpage; close #10 #13 #11

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

yacmov
Copy link
Collaborator

@yacmov yacmov commented May 28, 2024

System

Main system Test system using different IDE Test system using different platform
macOS macOS Windows 11 Arm
VS Code Pycharm VS Code

Agendar

Solution Description:

  • Setting port based on the platform to avoid conflicts.
  • Adjusting the file path relative path to absolute path
PREVIOUS PATH MODIFIED PATH
data/userdata.json app/data/userdata.json
config.example.ini app/config.example.ini
config.ini app/config.ini
static/img/ app/static/img

Solutions

1. Verify Port Usage:

  • Use alternative port ex: 5001, 5002 etc.
  • To avoid error code added code to check platform then if windows, use 5000 and macOS/Linux use 5002

2. Resolve Configuration File Path:

Screenshot - example problem with relative path with VS Code on macOS
image

Change to absolute path will solve the problem.

app.py
image

utils.py
image
image

3. Resolve Thumbnails issue

Warning

This issue doesn’t occur when I try to use it with PyCharm
But With VS Code has problem same as #13

Related path issue with various IDE that the script save Thumbnails image save on
Root/static/img/file_name.png

the the script try to access
root/**app**/static/img/file_name.png

adding app then read and write same location.

Previous

# Check if img dir exists if not create
if not os.path.exists("static/
    os.makedirs("static/img")
cv2.imwrite(f"static/img/{thumbnail}", frame)

Modified

# Check if img dir exists if not create
if not os.path.exists("app/static/
    os.makedirs("app/static/img")
cv2.imwrite(f"app/static/img/{thumbnail}", frame)
image

yacmov added 7 commits May 28, 2024 02:30
macOS often conflicts with port number 5000. Therefore, if the system is running on macOS, it may automatically open port 5001 to avoid conflicts.
…ni file

It is encountering a FileNotFoundError when running app.py in Visual Studio Code on my Mac. The issue was resolved by adding both the current and parent directories to the project path."
This commit adds two new test cases to ensure that the port number is correcly set based on whether the system is running macOS or Linux
@yacmov yacmov added bug Something isn't working good first issue Good for newcomers labels May 28, 2024
@yacmov yacmov requested a review from alisoohn May 28, 2024 04:16
@yacmov yacmov self-assigned this May 28, 2024
@yacmov yacmov changed the title Fix: Access localhost webpage; close #10 Fix: Access localhost webpage; close #10 #13 May 29, 2024
@yacmov yacmov requested a review from rafrafavi May 29, 2024 14:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Video Thumbnails in Video Library Not Shown Bug: unable to access "localhost:port"
1 participant