Skip to content

Commit

Permalink
feat: new getting started page
Browse files Browse the repository at this point in the history
fix: scan summaries not showing up for unresolved files
  • Loading branch information
5rahim committed Oct 27, 2024
1 parent bba1b90 commit 0edfdfa
Show file tree
Hide file tree
Showing 10 changed files with 451 additions and 293 deletions.
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ All notable changes to this project will be documented in this file.

## v2.2.1

- ⚡️ New getting started page
- ⚡️ Auto Downloader: Added 'additional terms' filter option
- 🦺 Torrent streaming: Fixed auto-select regression
- 🦺 Fixed auto-scanning regression
- 🦺 Torrent streaming: Fixed auto-select runtime error
- 🦺 Fixed auto-scanning runtime error
- 🦺 Fixed issue with inexistant log directory
- 🦺 Torrent streaming: Fixed runtime error caused by missing settings
- 🦺 Fixed scan summaries of unresolved files not showing up

## v2.2.0

Expand Down
27 changes: 27 additions & 0 deletions codegen/generated/handlers.json
Original file line number Diff line number Diff line change
Expand Up @@ -1365,6 +1365,15 @@
"required": true,
"descriptions": []
},
{
"name": "AdditionalTerms",
"jsonName": "additionalTerms",
"goType": "[]string",
"usedStructType": "",
"typescriptType": "Array\u003cstring\u003e",
"required": true,
"descriptions": []
},
{
"name": "ComparisonTitle",
"jsonName": "comparisonTitle",
Expand Down Expand Up @@ -6469,6 +6478,24 @@
"typescriptType": "boolean",
"required": true,
"descriptions": []
},
{
"name": "DebridProvider",
"jsonName": "debridProvider",
"goType": "string",
"usedStructType": "",
"typescriptType": "string",
"required": true,
"descriptions": []
},
{
"name": "DebridApiKey",
"jsonName": "debridApiKey",
"goType": "string",
"usedStructType": "",
"typescriptType": "string",
"required": true,
"descriptions": []
}
],
"returns": "handlers.Status",
Expand Down
2 changes: 1 addition & 1 deletion internal/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package constants
import "time"

const (
Version = "2.2.0"
Version = "2.2.1"
VersionName = "Sangatsu"
GcTime = time.Minute * 30
ConfigFileName = "config.toml"
Expand Down
8 changes: 8 additions & 0 deletions internal/handlers/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"errors"
"github.com/goccy/go-json"
"seanime/internal/database/models"
"seanime/internal/util"
"time"
)

Expand Down Expand Up @@ -72,6 +73,13 @@ func HandleLogin(c *RouteCtx) error {

c.App.InitOrRefreshModules()

go func() {
defer util.HandlePanicThen(func() {})
c.App.InitOrRefreshTorrentstreamSettings()
c.App.InitOrRefreshMediastreamSettings()
c.App.InitOrRefreshDebridSettings()
}()

// Return new status
return c.RespondWithData(status)

Expand Down
17 changes: 17 additions & 0 deletions internal/handlers/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ func HandleGettingStarted(c *RouteCtx) error {
Notifications models.NotificationSettings `json:"notifications"`
EnableTranscode bool `json:"enableTranscode"`
EnableTorrentStreaming bool `json:"enableTorrentStreaming"`
DebridProvider string `json:"debridProvider"`
DebridApiKey string `json:"debridApiKey"`
}
var b body

Expand Down Expand Up @@ -93,6 +95,7 @@ func HandleGettingStarted(c *RouteCtx) error {
prev, found := c.App.Database.GetTorrentstreamSettings()
if found {
prev.Enabled = true
//prev.IncludeInLibrary = true
_, _ = c.App.Database.UpsertTorrentstreamSettings(prev)
}
}()
Expand All @@ -109,6 +112,20 @@ func HandleGettingStarted(c *RouteCtx) error {
}()
}

if b.DebridProvider != "" && b.DebridProvider != "none" {
go func() {
defer util.HandlePanicThen(func() {})
prev, found := c.App.Database.GetDebridSettings()
if found {
prev.Enabled = true
prev.Provider = b.DebridProvider
prev.ApiKey = b.DebridApiKey
//prev.IncludeDebridStreamInLibrary = true
_, _ = c.App.Database.UpsertDebridSettings(prev)
}
}()
}

c.App.WSEventManager.SendEvent("settings", settings)

status := NewStatus(c)
Expand Down
11 changes: 6 additions & 5 deletions internal/library/autoscanner/autoscanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,11 +245,12 @@ func (as *AutoScanner) scan() {
return
}

// Save the scan summary
err = db_bridge.InsertScanSummary(as.db, scanSummaryLogger.GenerateSummary())
if err != nil {
as.logger.Error().Err(err).Msg("failed to insert scan summary")
}
}

// Save the scan summary
err = db_bridge.InsertScanSummary(as.db, scanSummaryLogger.GenerateSummary())
if err != nil {
as.logger.Error().Err(err).Msg("failed to insert scan summary")
}

// Refresh the queue
Expand Down
3 changes: 3 additions & 0 deletions seanime-web/src/api/generated/endpoint.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ export type CreateAutoDownloaderRule_Variables = {
mediaId: number
releaseGroups: Array<string>
resolutions: Array<string>
additionalTerms: Array<string>
comparisonTitle: string
titleComparisonType: Anime_AutoDownloaderRuleTitleComparisonType
episodeType: Anime_AutoDownloaderRuleEpisodeType
Expand Down Expand Up @@ -1324,6 +1325,8 @@ export type GettingStarted_Variables = {
notifications: Models_NotificationSettings
enableTranscode: boolean
enableTorrentStreaming: boolean
debridProvider: string
debridApiKey: string
}

/**
Expand Down
Loading

0 comments on commit 0edfdfa

Please sign in to comment.