Skip to content
Merged
5 changes: 4 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ let package = Package(
dependencies: [
.product(name: "Sparkle", package: "Sparkle")
],
exclude: [
"Resources/MockServer"
],
resources: [
.process("Resources")
.process("Resources/MenuBarIcon")
]
),
.testTarget(
Expand Down
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
PlexBar is a lightweight macOS menu bar app for Plex server telemetry.

<p align="center">
<img src="./docs/screenshots/screen-grab-streams.png" alt="Active streams" height="420" />
<img src="./docs/screenshots/screen-grab-history.png" alt="Playback history" height="420" />
<img src="./docs/screenshots/screen-grab-streams.png" alt="Active streams" height="300" />
<img src="./docs/screenshots/screen-grab-history.png" alt="Playback history" height="300" />
<img src="./docs/screenshots/screen-grab-users.png" alt="User activity" height="300" />
<img src="./docs/screenshots/screen-grab-libraries.png" alt="Library overview" height="300" />
</p>

## Features
Expand All @@ -30,6 +32,12 @@ To build and run the app:
script/build_and_run.sh
```

To run with mock data:

```bash
script/build_and_run.sh --mock
```

To package the app as a `dmg`:

```bash
Expand Down
25 changes: 18 additions & 7 deletions Sources/PlexBar/App/PlexBarApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,23 @@ struct PlexBarApp: App {
private let updateService: PlexUpdateService

init() {
let settingsStore = PlexSettingsStore()
let resolver = PlexConnectionResolver()
let runtime = PlexAppRuntime.current()
let settingsStore = runtime.settingsStore
let resolver = runtime.connectionResolver
let connectionStore = PlexConnectionStore(settings: settingsStore, resolver: resolver)
let sessionStore = PlexSessionStore(connectionStore: connectionStore)
let libraryStore = PlexLibraryStore(connectionStore: connectionStore)
let historyStore = PlexHistoryStore(connectionStore: connectionStore, libraryStore: libraryStore)
let serverPreviewStore = PlexServerPreviewStore(resolver: resolver)
let sessionStore = PlexSessionStore(
connectionStore: connectionStore,
client: runtime.apiClient,
geoIPClient: runtime.geoIPClient,
eventsClient: runtime.sessionEventsClient
)
let libraryStore = PlexLibraryStore(connectionStore: connectionStore, client: runtime.apiClient)
let historyStore = PlexHistoryStore(
connectionStore: connectionStore,
libraryStore: libraryStore,
client: runtime.apiClient
)
let serverPreviewStore = PlexServerPreviewStore(client: runtime.apiClient, resolver: resolver)
_settingsStore = State(initialValue: settingsStore)
_connectionStore = State(initialValue: connectionStore)
_sessionStore = State(initialValue: sessionStore)
Expand All @@ -39,7 +49,8 @@ struct PlexBarApp: App {
connectionStore: connectionStore,
sessionStore: sessionStore,
historyStore: historyStore,
libraryStore: libraryStore
libraryStore: libraryStore,
client: runtime.authClient
))
updateService = PlexUpdateService()
}
Expand Down
6 changes: 5 additions & 1 deletion Sources/PlexBar/Models/PlexServerPreview.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@ struct PlexServerPreviewItem: Identifiable, Equatable {
let artworkPath: String?
let addedAt: Date

var displayArtworkPath: String? {
posterPath ?? artworkPath
}

var hasArtwork: Bool {
posterPath != nil || artworkPath != nil
displayArtworkPath != nil
}
}

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading