mirror of
https://github.com/hrfee/jfa-go.git
synced 2025-04-20 01:52:53 +00:00
Compare commits
No commits in common. "1a6d78352c2d5c2d827aac2a7ea516768157861b" and "618cc32a17f94d7caca5fab927d0a12207c69ce7" have entirely different histories.
1a6d78352c
...
618cc32a17
@ -52,11 +52,6 @@
|
|||||||
padding: var(--spacing-4,1rem);
|
padding: var(--spacing-4,1rem);
|
||||||
}
|
}
|
||||||
|
|
||||||
.modal-content .banner {
|
|
||||||
margin-left: calc(-1 * var(--spacing-4,1rem) - 0.5%); /* Not sure why this is necessary */
|
|
||||||
margin-right: calc(-1 * var(--spacing-4,1rem) - 0.5%);
|
|
||||||
}
|
|
||||||
|
|
||||||
div.card:contains(section.banner.footer) {
|
div.card:contains(section.banner.footer) {
|
||||||
padding-bottom: 0px;
|
padding-bottom: 0px;
|
||||||
}
|
}
|
||||||
|
@ -40,8 +40,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div id="modal-about" class="modal">
|
<div id="modal-about" class="modal">
|
||||||
<div class="modal-content content card">
|
<div class="modal-content content card">
|
||||||
<img src="{{ .urlBase }}/banner.svg" class="banner header" alt="jfa-go banner">
|
<span class="heading">{{ .strings.aboutProgram }} <span class="modal-close">×</span></span>
|
||||||
<span class="heading"><span class="modal-close">×</span></span>
|
<img src="{{ .urlBase }}/banner.svg" class="mt-1" alt="jfa-go banner">
|
||||||
<p><i class="icon ri-github-fill"></i><a href="https://github.com/hrfee/jfa-go">jfa-go</a></p>
|
<p><i class="icon ri-github-fill"></i><a href="https://github.com/hrfee/jfa-go">jfa-go</a></p>
|
||||||
<p>{{ .strings.version }} <span class="code monospace">{{ .version }}</span></p>
|
<p>{{ .strings.version }} <span class="code monospace">{{ .version }}</span></p>
|
||||||
<p>{{ .strings.commitNoun }} <span class="code monospace">{{ .commit }}</span></p>
|
<p>{{ .strings.commitNoun }} <span class="code monospace">{{ .commit }}</span></p>
|
||||||
|
2
main.go
2
main.go
@ -79,7 +79,7 @@ type appContext struct {
|
|||||||
configBase settings
|
configBase settings
|
||||||
dataPath string
|
dataPath string
|
||||||
webFS httpFS
|
webFS httpFS
|
||||||
cssClass string // Default theme, "light-theme"|"dark-theme".
|
cssClass string
|
||||||
jellyfinLogin bool
|
jellyfinLogin bool
|
||||||
users []User
|
users []User
|
||||||
invalidTokens []string
|
invalidTokens []string
|
||||||
|
@ -1,6 +1,3 @@
|
|||||||
// Mediabrowser provides user-related bindings to the Jellyfin & Emby APIs.
|
|
||||||
// Some data aren't bound to structs as jfa-go doesn't need to interact with them, for example DisplayPreferences.
|
|
||||||
// See Jellyfin/Emby swagger docs for more info on them.
|
|
||||||
package mediabrowser
|
package mediabrowser
|
||||||
|
|
||||||
import (
|
import (
|
||||||
@ -24,8 +21,7 @@ const (
|
|||||||
EmbyServer
|
EmbyServer
|
||||||
)
|
)
|
||||||
|
|
||||||
// ServerInfo stores info about the server.
|
type serverInfo struct {
|
||||||
type ServerInfo struct {
|
|
||||||
LocalAddress string `json:"LocalAddress"`
|
LocalAddress string `json:"LocalAddress"`
|
||||||
Name string `json:"ServerName"`
|
Name string `json:"ServerName"`
|
||||||
Version string `json:"Version"`
|
Version string `json:"Version"`
|
||||||
@ -43,7 +39,7 @@ type MediaBrowser struct {
|
|||||||
useragent string
|
useragent string
|
||||||
auth string
|
auth string
|
||||||
header map[string]string
|
header map[string]string
|
||||||
ServerInfo ServerInfo
|
ServerInfo serverInfo
|
||||||
Username string
|
Username string
|
||||||
password string
|
password string
|
||||||
Authenticated bool
|
Authenticated bool
|
||||||
@ -60,7 +56,7 @@ type MediaBrowser struct {
|
|||||||
timeoutHandler common.TimeoutHandler
|
timeoutHandler common.TimeoutHandler
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewServer returns a new Mediabrowser object.
|
// NewServer returns a new Jellyfin object.
|
||||||
func NewServer(st serverType, server, client, version, device, deviceID string, timeoutHandler common.TimeoutHandler, cacheTimeout int) (*MediaBrowser, error) {
|
func NewServer(st serverType, server, client, version, device, deviceID string, timeoutHandler common.TimeoutHandler, cacheTimeout int) (*MediaBrowser, error) {
|
||||||
mb := &MediaBrowser{}
|
mb := &MediaBrowser{}
|
||||||
mb.serverType = st
|
mb.serverType = st
|
||||||
|
@ -11,7 +11,6 @@ type magicParse struct {
|
|||||||
Parsed time.Time `json:"parseme"`
|
Parsed time.Time `json:"parseme"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Time embeds time.Time with a custom JSON Unmarshal method to work with Jellyfin & Emby's time formatting.
|
|
||||||
type Time struct {
|
type Time struct {
|
||||||
time.Time
|
time.Time
|
||||||
}
|
}
|
||||||
@ -63,8 +62,7 @@ type User struct {
|
|||||||
LastLoginDate Time `json:"LastLoginDate"`
|
LastLoginDate Time `json:"LastLoginDate"`
|
||||||
LastActivityDate Time `json:"LastActivityDate"`
|
LastActivityDate Time `json:"LastActivityDate"`
|
||||||
Configuration Configuration `json:"Configuration"`
|
Configuration Configuration `json:"Configuration"`
|
||||||
// Policy stores the user's permissions.
|
Policy Policy `json:"Policy"`
|
||||||
Policy Policy `json:"Policy"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type SessionInfo struct {
|
type SessionInfo struct {
|
||||||
|
@ -76,7 +76,6 @@ func (app *appContext) checkUsers() {
|
|||||||
}
|
}
|
||||||
if !found {
|
if !found {
|
||||||
app.info.Printf("Expired user already deleted, ignoring.")
|
app.info.Printf("Expired user already deleted, ignoring.")
|
||||||
delete(app.storage.users, id)
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
app.info.Printf("%s expired user \"%s\"", termPlural, user.Name)
|
app.info.Printf("%s expired user \"%s\"", termPlural, user.Name)
|
||||||
|
Loading…
Reference in New Issue
Block a user