Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,9 @@ jobs:
go-version: "1.26"
cache: true
- name: Generate
run: go run github.com/dennwc/flatpak-go-mod@latest
run: |
go run github.com/dennwc/flatpak-go-mod@latest
sed -i 's|path: modules.txt|path: assets/meta/modules.txt|' go.mod.yml
- name: Diff
run: |
if ! diff -q go.mod.yml assets/meta/go.mod.yml > /dev/null 2>&1 || \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ then add this anywhere in your system configuration as you see fit
## Acknowledgements
The following projects and resources served as inspiration or were helpful during the development of Scanline.
- [Tonearm](https://codeberg.org/dergs/Tonearm) and its [schwifty](https://codeberg.org/dergs/Tonearm/src/branch/main/pkg/schwifty) UI framework for providing the foundation
- [puregotk](https://github.com/jwijenbergh/puregotk) for making this project possible with only minimal CGO bindings
- [puregotk](https://codeberg.org/puregotk/puregotk) for making this project possible with only minimal CGO bindings
- [Plex](https://www.plex.tv/) for the media server platform
- [Dråfølin](https://drafolin.ch/) for the beautiful icon

Expand Down
6 changes: 3 additions & 3 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import (
"context"
"log/slog"

"codeberg.org/puregotk/puregotk/v4/adw"
"codeberg.org/puregotk/puregotk/v4/gio"
"github.com/0skillallluck/scanline/app/appctx"
"github.com/0skillallluck/scanline/app/dialogs/secretservice"
"github.com/0skillallluck/scanline/app/router"
"github.com/0skillallluck/scanline/app/secrets"
"github.com/0skillallluck/scanline/app/sources"
"github.com/0skillallluck/scanline/app/windows"
"github.com/0skillallluck/scanline/app/secrets"
"github.com/jwijenbergh/puregotk/v4/adw"
"github.com/jwijenbergh/puregotk/v4/gio"
)

func OnActivate(application *adw.Application) func(gio.Application) {
Expand Down
2 changes: 1 addition & 1 deletion app/appctx/appctx.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package appctx
import (
"context"

"codeberg.org/puregotk/puregotk/v4/gtk"
"github.com/0skillallluck/scanline/app/sources"
"github.com/jwijenbergh/puregotk/v4/gtk"
)

type AppContext struct {
Expand Down
8 changes: 4 additions & 4 deletions app/auth/signin.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import (
"sync"

"codeberg.org/dergs/tonearm/pkg/schwifty"
"codeberg.org/puregotk/puregotk/v4/adw"
"codeberg.org/puregotk/puregotk/v4/gtk"
"github.com/0skillallluck/scanline/app/dialogs/linking"
"github.com/0skillallluck/scanline/app/secrets"
"github.com/0skillallluck/scanline/app/sources"
"github.com/0skillallluck/scanline/internal/gettext"
"github.com/0skillallluck/scanline/utils/notifications"
"github.com/0skillallluck/scanline/app/secrets"
"github.com/0skillallluck/scanline/provider/plex/auth"
"github.com/jwijenbergh/puregotk/v4/adw"
"github.com/jwijenbergh/puregotk/v4/gtk"
"github.com/0skillallluck/scanline/utils/notifications"
)

// PerformSignIn runs the full Plex sign-in flow in a goroutine:
Expand Down
4 changes: 2 additions & 2 deletions app/components/cards/cast.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package cards
import (
"codeberg.org/dergs/tonearm/pkg/schwifty"
. "codeberg.org/dergs/tonearm/pkg/schwifty/syntax"
"codeberg.org/puregotk/puregotk/v4/gtk"
"codeberg.org/puregotk/puregotk/v4/pango"
"github.com/0skillallluck/scanline/app/preference"
"github.com/0skillallluck/scanline/utils/imageutils"
"github.com/jwijenbergh/puregotk/v4/gtk"
"github.com/jwijenbergh/puregotk/v4/pango"
)

func NewCastMember(name, role, thumbURL string) schwifty.Box {
Expand Down
2 changes: 1 addition & 1 deletion app/components/cards/info_card.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package cards
import (
"codeberg.org/dergs/tonearm/pkg/schwifty"
. "codeberg.org/dergs/tonearm/pkg/schwifty/syntax"
"github.com/jwijenbergh/puregotk/v4/gtk"
"codeberg.org/puregotk/puregotk/v4/gtk"
)

func NewInfoCard(icon, title, subtitle string) schwifty.Box {
Expand Down
4 changes: 2 additions & 2 deletions app/components/cards/media_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (

"codeberg.org/dergs/tonearm/pkg/schwifty"
. "codeberg.org/dergs/tonearm/pkg/schwifty/syntax"
"github.com/0skillallluck/scanline/internal/gettext"
"codeberg.org/puregotk/puregotk/v4/gtk"
"github.com/0skillallluck/scanline/app/sources"
"github.com/jwijenbergh/puregotk/v4/gtk"
"github.com/0skillallluck/scanline/internal/gettext"
)

// MediaInfo creates an HStack of info cards showing resolution, video codec, audio, and container.
Expand Down
6 changes: 3 additions & 3 deletions app/components/cards/poster.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ package cards
import (
"codeberg.org/dergs/tonearm/pkg/schwifty"
. "codeberg.org/dergs/tonearm/pkg/schwifty/syntax"
"codeberg.org/puregotk/puregotk/v4/gdk"
"codeberg.org/puregotk/puregotk/v4/gtk"
"codeberg.org/puregotk/puregotk/v4/pango"
"github.com/0skillallluck/scanline/app/preference"
"github.com/0skillallluck/scanline/utils/imageutils"
"github.com/jwijenbergh/puregotk/v4/gdk"
"github.com/jwijenbergh/puregotk/v4/gtk"
"github.com/jwijenbergh/puregotk/v4/pango"
)

func poster[T any](title string, subTitle schwifty.Widgetable[T], coverURL string) schwifty.Button {
Expand Down
2 changes: 1 addition & 1 deletion app/components/cards/poster_episode.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (

"codeberg.org/dergs/tonearm/pkg/schwifty"
. "codeberg.org/dergs/tonearm/pkg/schwifty/syntax"
"codeberg.org/puregotk/puregotk/v4/glib"
"github.com/0skillallluck/scanline/app/sources"
"github.com/jwijenbergh/puregotk/v4/glib"
)

// NewEpisodePoster creates a new poster card for a tv-show episode.
Expand Down
2 changes: 1 addition & 1 deletion app/components/cards/poster_movie.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"strconv"

"codeberg.org/dergs/tonearm/pkg/schwifty"
"codeberg.org/puregotk/puregotk/v4/glib"
"github.com/0skillallluck/scanline/app/sources"
"github.com/jwijenbergh/puregotk/v4/glib"
)

// NewMoviePoster creates a new poster card for a movie.
Expand Down
2 changes: 1 addition & 1 deletion app/components/cards/poster_season.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package cards

import (
"codeberg.org/dergs/tonearm/pkg/schwifty"
"codeberg.org/puregotk/puregotk/v4/glib"
"github.com/0skillallluck/scanline/app/sources"
"github.com/0skillallluck/scanline/internal/gettext"
"github.com/jwijenbergh/puregotk/v4/glib"
)

// NewSeasonPoster creates a new poster card for a tv-show season.
Expand Down
2 changes: 1 addition & 1 deletion app/components/cards/poster_show.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package cards

import (
"codeberg.org/dergs/tonearm/pkg/schwifty"
"codeberg.org/puregotk/puregotk/v4/glib"
"github.com/0skillallluck/scanline/app/sources"
"github.com/0skillallluck/scanline/internal/gettext"
"github.com/jwijenbergh/puregotk/v4/glib"
)

// NewShowPoster creates a new poster card for a tv-show.
Expand Down
8 changes: 4 additions & 4 deletions app/components/cards/preview.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ package cards
import (
"codeberg.org/dergs/tonearm/pkg/schwifty"
. "codeberg.org/dergs/tonearm/pkg/schwifty/syntax"
"codeberg.org/puregotk/puregotk/v4/gdk"
"codeberg.org/puregotk/puregotk/v4/gtk"
"codeberg.org/puregotk/puregotk/v4/pango"
"github.com/0skillallluck/scanline/app/preference"
"github.com/0skillallluck/scanline/utils/imageutils"
"github.com/jwijenbergh/puregotk/v4/gdk"
"github.com/jwijenbergh/puregotk/v4/gtk"
"github.com/jwijenbergh/puregotk/v4/pango"
)

func previewCard[T any](title string, subTitle schwifty.Widgetable[T], artURL string, progress float64) schwifty.Button {
// Progress bar width based on progress
progressWidth := int(480 * progress)
progressWidth := int32(480 * progress)

// Create the picture widget
picture := Picture().
Expand Down
2 changes: 1 addition & 1 deletion app/components/cards/preview_episode.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (

"codeberg.org/dergs/tonearm/pkg/schwifty"
. "codeberg.org/dergs/tonearm/pkg/schwifty/syntax"
"codeberg.org/puregotk/puregotk/v4/glib"
"github.com/0skillallluck/scanline/app/sources"
"github.com/jwijenbergh/puregotk/v4/glib"
)

// NewEpisodePreviewCard creates a new 16:9 preview card for a tv-show episode.
Expand Down
2 changes: 1 addition & 1 deletion app/components/cards/preview_movie.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"strconv"

"codeberg.org/dergs/tonearm/pkg/schwifty"
"codeberg.org/puregotk/puregotk/v4/glib"
"github.com/0skillallluck/scanline/app/sources"
"github.com/jwijenbergh/puregotk/v4/glib"
)

// NewMoviePreviewCard creates a new 16:9 preview card for a movie.
Expand Down
8 changes: 4 additions & 4 deletions app/components/cards/season_episode.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ package cards
import (
"codeberg.org/dergs/tonearm/pkg/schwifty"
. "codeberg.org/dergs/tonearm/pkg/schwifty/syntax"
"codeberg.org/puregotk/puregotk/v4/gdk"
"codeberg.org/puregotk/puregotk/v4/glib"
"codeberg.org/puregotk/puregotk/v4/gtk"
"codeberg.org/puregotk/puregotk/v4/pango"
"github.com/0skillallluck/scanline/app/preference"
"github.com/0skillallluck/scanline/app/sources"
"github.com/0skillallluck/scanline/internal/gettext"
"github.com/0skillallluck/scanline/utils/imageutils"
"github.com/jwijenbergh/puregotk/v4/gdk"
"github.com/jwijenbergh/puregotk/v4/glib"
"github.com/jwijenbergh/puregotk/v4/gtk"
"github.com/jwijenbergh/puregotk/v4/pango"
)

func NewSeasonEpisode(metadata *sources.Metadata, coverURL, serverID string) schwifty.Button {
Expand Down
4 changes: 2 additions & 2 deletions app/components/cards/subtitle.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package cards
import (
"codeberg.org/dergs/tonearm/pkg/schwifty"
. "codeberg.org/dergs/tonearm/pkg/schwifty/syntax"
"github.com/jwijenbergh/puregotk/v4/gtk"
"github.com/jwijenbergh/puregotk/v4/pango"
"codeberg.org/puregotk/puregotk/v4/gtk"
"codeberg.org/puregotk/puregotk/v4/pango"
)

func subTitle(text string) schwifty.Label {
Expand Down
12 changes: 6 additions & 6 deletions app/components/lists/horizontal_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ package lists
import (
"math"

"github.com/0skillallluck/scanline/internal/gettext"
"github.com/0skillallluck/scanline/app/router"
"codeberg.org/dergs/tonearm/pkg/schwifty"
"codeberg.org/dergs/tonearm/pkg/schwifty/state"
. "codeberg.org/dergs/tonearm/pkg/schwifty/syntax"
"github.com/jwijenbergh/puregotk/v4/gtk"
"codeberg.org/puregotk/puregotk/v4/gtk"
"github.com/0skillallluck/scanline/app/router"
"github.com/0skillallluck/scanline/internal/gettext"
)

type HorizontalList struct {
schwifty.Box

container *gtk.Box
marginState *state.State[int]
marginState *state.State[int32]
routeButtonState *state.State[any]
}

Expand All @@ -24,7 +24,7 @@ func (h *HorizontalList) Append(child schwifty.BaseWidgetable) *HorizontalList {
return h
}

func (h *HorizontalList) SetPageMargin(margin int) *HorizontalList {
func (h *HorizontalList) SetPageMargin(margin int32) *HorizontalList {
h.marginState.SetValue(margin)
return h
}
Expand All @@ -43,7 +43,7 @@ func (h *HorizontalList) SetViewAllRoute(path string) *HorizontalList {
}

func NewHorizontalList(title string) *HorizontalList {
marginState := state.NewStateful[int](0)
marginState := state.NewStateful[int32](0)
routeButtonState := state.NewStateful[any](nil)
container := HStack().BindHMargin(marginState)()

Expand Down
36 changes: 18 additions & 18 deletions app/components/player/player.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import (

"codeberg.org/dergs/tonearm/pkg/schwifty"
. "codeberg.org/dergs/tonearm/pkg/schwifty/syntax"
"codeberg.org/puregotk/puregotk/v4/gdk"
"codeberg.org/puregotk/puregotk/v4/gio"
"codeberg.org/puregotk/puregotk/v4/glib"
"codeberg.org/puregotk/puregotk/v4/gtk"
"github.com/0skillallluck/scanline/app/sources"
"github.com/google/uuid"
"github.com/jwijenbergh/puregotk/v4/gdk"
"github.com/jwijenbergh/puregotk/v4/gio"
"github.com/jwijenbergh/puregotk/v4/glib"
"github.com/jwijenbergh/puregotk/v4/gtk"
)

// PlayerParams configures a new player window.
Expand All @@ -23,7 +23,7 @@ type PlayerParams struct {
Title string
PartKey string // raw media part key (e.g. "/library/parts/12345/file.mkv")
Window *gtk.Window
RatingKey string // metadata ratingKey
RatingKey string // metadata ratingKey
Media []sources.Media // full Media array from Metadata
Source sources.Source // the source for this playback
}
Expand Down Expand Up @@ -64,7 +64,7 @@ func NewPlayer(params PlayerParams) {
gtk.StyleContextAddProviderForDisplay(
display,
cssProvider,
uint(gtk.STYLE_PROVIDER_PRIORITY_APPLICATION),
uint32(gtk.STYLE_PROVIDER_PRIORITY_APPLICATION),
)
win.AddCssClass("scanline-player-window")
overlay.AddCssClass("scanline-player-overlay")
Expand Down Expand Up @@ -426,7 +426,7 @@ func NewPlayer(params PlayerParams) {
// Only start timer if not already running
if hideTimerID.Load() == 0 {
id := glib.TimeoutAdd(500, &hideTimerCallback, 0) // check every 500ms
hideTimerID.Store(uint32(id))
hideTimerID.Store(id)
}
}

Expand All @@ -453,7 +453,7 @@ func NewPlayer(params PlayerParams) {
if settingsPopover != nil {
mapCb := func(w gtk.Widget) {
if old := hideTimerID.Load(); old != 0 {
glib.SourceRemove(uint(old))
glib.SourceRemove(old)
hideTimerID.Store(0)
}
showControls()
Expand All @@ -468,12 +468,12 @@ func NewPlayer(params PlayerParams) {

// --- ESC key to close ---
keyCtrl := gtk.NewEventControllerKey()
keyPressedCb := func(ctrl gtk.EventControllerKey, keyval uint, keycode uint, state gdk.ModifierType) bool {
keyPressedCb := func(ctrl gtk.EventControllerKey, keyval uint32, keycode uint32, state gdk.ModifierType) bool {
switch keyval {
case uint(gdk.KEY_Escape):
case uint32(gdk.KEY_Escape):
win.Close()
return true
case uint(gdk.KEY_space):
case uint32(gdk.KEY_space):
if media == nil {
return true
}
Expand All @@ -493,15 +493,15 @@ func NewPlayer(params PlayerParams) {
sendProgress(sources.StatePlaying)
}
return true
case uint(gdk.KEY_Left):
case uint32(gdk.KEY_Left):
if media == nil {
return true
}
ts := media.GetTimestamp()
newTS := max(ts-30*1000000, 0)
doSeek(newTS)
return true
case uint(gdk.KEY_Right):
case uint32(gdk.KEY_Right):
if media == nil {
return true
}
Expand All @@ -513,7 +513,7 @@ func NewPlayer(params PlayerParams) {
}
doSeek(newTS)
return true
case uint(gdk.KEY_Up):
case uint32(gdk.KEY_Up):
if media == nil {
return true
}
Expand All @@ -523,7 +523,7 @@ func NewPlayer(params PlayerParams) {
}
media.SetVolume(vol)
return true
case uint(gdk.KEY_Down):
case uint32(gdk.KEY_Down):
if media == nil {
return true
}
Expand Down Expand Up @@ -589,7 +589,7 @@ func NewPlayer(params PlayerParams) {
return true // G_SOURCE_CONTINUE
})
tid := glib.TimeoutAdd(500, &tickerCb, 0)
tickerID.Store(uint32(tid))
tickerID.Store(tid)

// --- Set up window ---
win.SetChild(&overlay.Widget)
Expand All @@ -609,11 +609,11 @@ func NewPlayer(params PlayerParams) {
media.Pause()
}
if id := tickerID.Load(); id != 0 {
glib.SourceRemove(uint(id))
glib.SourceRemove(id)
tickerID.Store(0)
}
if id := hideTimerID.Load(); id != 0 {
glib.SourceRemove(uint(id))
glib.SourceRemove(id)
hideTimerID.Store(0)
}
// Remove CSS provider to avoid affecting other windows
Expand Down
Loading