Skip to content

Commit

Permalink
Optimize the way to read the configuration file
Browse files Browse the repository at this point in the history
  • Loading branch information
x1ao4 authored Mar 13, 2024
1 parent 678ffe0 commit c943ec6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion en/plex-scanner/plex-scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
import requests
import configparser
import xml.etree.ElementTree as ET
from pathlib import Path

# Define the configuration file path
config_file: Path = Path(__file__).parent / 'config.ini'

# Read the configuration file
config = configparser.ConfigParser()
config.read('config.ini')
config.read(config_file)

# Get the server address and token
plex_server = config.get('server', 'address')
Expand Down

0 comments on commit c943ec6

Please sign in to comment.