Merge pull request #77 from gnattu/qol-improvements
Use server config to open URL and use new logos
@ -11,7 +11,8 @@ import Foundation
|
||||
|
||||
enum ActionManager {
|
||||
static func launchWebUI() {
|
||||
NSWorkspace.shared.open(.init(string: "http://localhost:8096")!)
|
||||
let (port, proto, subPath) = getJellyfinNetworkConfig()
|
||||
NSWorkspace.shared.open(.init(string: "\(proto)://localhost:\(port)\(subPath)")!)
|
||||
}
|
||||
|
||||
static func showLogs() {
|
||||
|
After Width: | Height: | Size: 8.0 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 56 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 5.4 KiB |
After Width: | Height: | Size: 56 KiB |
After Width: | Height: | Size: 169 KiB |
@ -1,68 +1,68 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"size" : "16x16",
|
||||
"filename" : "AppIcon16x16.png",
|
||||
"idiom" : "mac",
|
||||
"filename" : "icon_16x16.png",
|
||||
"scale" : "1x"
|
||||
"scale" : "1x",
|
||||
"size" : "16x16"
|
||||
},
|
||||
{
|
||||
"size" : "16x16",
|
||||
"filename" : "AppIcon16x16@2x.png",
|
||||
"idiom" : "mac",
|
||||
"filename" : "icon_16x16@2x.png",
|
||||
"scale" : "2x"
|
||||
"scale" : "2x",
|
||||
"size" : "16x16"
|
||||
},
|
||||
{
|
||||
"size" : "32x32",
|
||||
"filename" : "AppIcon32x32.png",
|
||||
"idiom" : "mac",
|
||||
"filename" : "icon_32x32.png",
|
||||
"scale" : "1x"
|
||||
"scale" : "1x",
|
||||
"size" : "32x32"
|
||||
},
|
||||
{
|
||||
"size" : "32x32",
|
||||
"filename" : "AppIcon32x32@2x.png",
|
||||
"idiom" : "mac",
|
||||
"filename" : "icon_32x32@2x.png",
|
||||
"scale" : "2x"
|
||||
"scale" : "2x",
|
||||
"size" : "32x32"
|
||||
},
|
||||
{
|
||||
"size" : "128x128",
|
||||
"filename" : "AppIcon128x128.png",
|
||||
"idiom" : "mac",
|
||||
"filename" : "icon_128x128.png",
|
||||
"scale" : "1x"
|
||||
"scale" : "1x",
|
||||
"size" : "128x128"
|
||||
},
|
||||
{
|
||||
"size" : "128x128",
|
||||
"filename" : "AppIcon128x128@2x.png",
|
||||
"idiom" : "mac",
|
||||
"filename" : "icon_128x128@2x.png",
|
||||
"scale" : "2x"
|
||||
"scale" : "2x",
|
||||
"size" : "128x128"
|
||||
},
|
||||
{
|
||||
"size" : "256x256",
|
||||
"filename" : "AppIcon256x256.png",
|
||||
"idiom" : "mac",
|
||||
"filename" : "icon_256x256.png",
|
||||
"scale" : "1x"
|
||||
"scale" : "1x",
|
||||
"size" : "256x256"
|
||||
},
|
||||
{
|
||||
"size" : "256x256",
|
||||
"filename" : "AppIcon256x256@2x.png",
|
||||
"idiom" : "mac",
|
||||
"filename" : "icon_256x256@2x.png",
|
||||
"scale" : "2x"
|
||||
"scale" : "2x",
|
||||
"size" : "256x256"
|
||||
},
|
||||
{
|
||||
"size" : "512x512",
|
||||
"filename" : "AppIcon512x512.png",
|
||||
"idiom" : "mac",
|
||||
"filename" : "icon_512x512.png",
|
||||
"scale" : "1x"
|
||||
"scale" : "1x",
|
||||
"size" : "512x512"
|
||||
},
|
||||
{
|
||||
"size" : "512x512",
|
||||
"filename" : "AppIcon512x512@2x.png",
|
||||
"idiom" : "mac",
|
||||
"filename" : "appicon@2x.png",
|
||||
"scale" : "2x"
|
||||
"scale" : "2x",
|
||||
"size" : "512x512"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 95 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 91 KiB |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 6.7 KiB |
Before Width: | Height: | Size: 91 KiB |
@ -11,7 +11,7 @@
|
||||
"value" : "light"
|
||||
}
|
||||
],
|
||||
"filename" : "jellyfin-banner-light.png",
|
||||
"filename" : "logo-light.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
@ -22,7 +22,7 @@
|
||||
"value" : "dark"
|
||||
}
|
||||
],
|
||||
"filename" : "jellyfin-banner-dark.png",
|
||||
"filename" : "logo-dark.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
|
Before Width: | Height: | Size: 153 KiB |
Before Width: | Height: | Size: 151 KiB |
BIN
Jellyfin Server/Assets.xcassets/jellyfin-banner.imageset/logo-dark.png
vendored
Normal file
After Width: | Height: | Size: 82 KiB |
BIN
Jellyfin Server/Assets.xcassets/jellyfin-banner.imageset/logo-light.png
vendored
Normal file
After Width: | Height: | Size: 85 KiB |
@ -18,3 +18,47 @@ func directoryExists(path: String) -> Bool {
|
||||
var isDirectory: ObjCBool = false
|
||||
return FileManager.default.fileExists(atPath: path, isDirectory: &isDirectory)
|
||||
}
|
||||
|
||||
func getJellyfinNetworkConfig() -> (port: String, proto: String, subPath:String) {
|
||||
let configFile: URL = directoryExists(path: localShareJellyfinFolder.path)
|
||||
? localShareJellyfinFolder.appendingPathComponent("config/network.xml")
|
||||
: applicationSupportJellyfinFolder.appendingPathComponent("config/network.xml")
|
||||
var httpPort = "8096"
|
||||
var httpsPort = "8920"
|
||||
var requireHttps = false
|
||||
var enableHttps = false
|
||||
var subPath = ""
|
||||
do {
|
||||
let config = try XMLDocument(contentsOf: configFile)
|
||||
try config.validate()
|
||||
if let rootElement = config.rootElement() {
|
||||
if let internalHttpPort = rootElement.elements(forName: "InternalHttpPort").first?.stringValue {
|
||||
httpPort = internalHttpPort
|
||||
}
|
||||
|
||||
if let internalHttpsPort = rootElement.elements(forName: "InternalHttpsPort").first?.stringValue {
|
||||
httpsPort = internalHttpsPort
|
||||
}
|
||||
|
||||
if let enableHttpsString = rootElement.elements(forName: "EnableHttps").first?.stringValue {
|
||||
enableHttps = (enableHttpsString as NSString).boolValue
|
||||
}
|
||||
|
||||
if let requireHttpsString = rootElement.elements(forName: "RequireHttps").first?.stringValue {
|
||||
requireHttps = (requireHttpsString as NSString).boolValue
|
||||
}
|
||||
|
||||
if let baseUrl = rootElement.elements(forName: "BaseUrl").first?.stringValue, !baseUrl.isEmpty {
|
||||
subPath = baseUrl
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
print("Jellyfin Server config is invalid, using default values.")
|
||||
}
|
||||
|
||||
if requireHttps && enableHttps {
|
||||
return (httpsPort, "https", subPath)
|
||||
} else {
|
||||
return (httpPort, "http", subPath)
|
||||
}
|
||||
}
|
||||
|