diff --git a/pkg/sqlite/scene.go b/pkg/sqlite/scene.go index 819e3dcea..99b2254c0 100644 --- a/pkg/sqlite/scene.go +++ b/pkg/sqlite/scene.go @@ -1596,6 +1596,8 @@ func (qb *SceneStore) setSceneSort(query *queryBuilder, findFilter *models.FindF query.sortAndPagination += getCountSort(sceneTable, scenesViewDatesTable, sceneIDColumn, direction) case "last_played_at": query.sortAndPagination += fmt.Sprintf(" ORDER BY (SELECT MAX(view_date) FROM %s AS sort WHERE sort.%s = %s.id) %s", scenesViewDatesTable, sceneIDColumn, sceneTable, getSortDirection(direction)) + case "last_o_at": + query.sortAndPagination += fmt.Sprintf(" ORDER BY (SELECT MAX(o_date) FROM %s AS sort WHERE sort.%s = %s.id) %s", scenesODatesTable, sceneIDColumn, sceneTable, getSortDirection(direction)) case "o_counter": query.sortAndPagination += getCountSort(sceneTable, scenesODatesTable, sceneIDColumn, direction) default: diff --git a/ui/v2.5/src/locales/en-GB.json b/ui/v2.5/src/locales/en-GB.json index d77905498..3a2709d6b 100644 --- a/ui/v2.5/src/locales/en-GB.json +++ b/ui/v2.5/src/locales/en-GB.json @@ -1068,6 +1068,7 @@ "interactive": "Interactive", "interactive_speed": "Interactive speed", "isMissing": "Is Missing", + "last_o_at": "Last O At", "last_played_at": "Last Played At", "library": "Library", "loading": { diff --git a/ui/v2.5/src/models/list-filter/scenes.ts b/ui/v2.5/src/models/list-filter/scenes.ts index ca9dc3717..5744faa0b 100644 --- a/ui/v2.5/src/models/list-filter/scenes.ts +++ b/ui/v2.5/src/models/list-filter/scenes.ts @@ -42,6 +42,7 @@ const sortByOptions = [ "framerate", "bitrate", "last_played_at", + "last_o_at", "resume_time", "play_duration", "play_count",