Radiicall / jellyfin-rpc

Displays the content you're currently watching on Discord!
GNU General Public License v3.0
238 stars 18 forks source link

Default config file name fixes #163

Closed 220111 closed 1 month ago

220111 commented 1 month ago

Fixes #162. This PR fixes an unclear function comment and adds a clean error exit to the failure to find a config file. I believe this is better for a user that hasn't made their config file yet or passing the wrong path parameter compared to just panicking.

Example run with missing main.json

> .\jellyfin-rpc.exe
2024-10-24 13:58:46 INFO  [jellyfin_rpc] Initializing Jellyfin-RPC
2024-10-24 13:58:47 ERROR [jellyfin_rpc] Config file could not be found at path: C:\Users\tronl\AppData\Roaming\jellyfin-rpc\main.json
2024-10-24 13:58:47 ERROR [jellyfin_rpc] Please create a proper config file: https://github.com/Radiicall/jellyfin-rpc/wiki/Setup

Example run with incorrect config parameter

> .\jellyfin-rpc.exe -c ./config.json
2024-10-24 14:03:21 INFO  [jellyfin_rpc] Initializing Jellyfin-RPC
2024-10-24 14:03:21 ERROR [jellyfin_rpc] Config file could not be found at path: ./config.json
2024-10-24 14:03:21 ERROR [jellyfin_rpc] Please create a proper config file: https://github.com/Radiicall/jellyfin-rpc/wiki/Setup