feat: add support for custom favicons (#4770)
* feat: add support for custom favicons * Commit updated API documentation * chore(i18n): add localization of text * fix(js): regenerate package lock file * chore(test): add favicon test * fix: max size not respected * Commit updated API documentation * fix: move favicon.ico to the static dir * fix: fix tests * fix: remove hard-coded content-type of icon * chore: update extracted translations * feat(admin): add support for resetting to default icon * chore: use a higher res default favicon * Commit updated API documentation --------- Co-authored-by: Owncast <owncast@owncast.online>
This commit is contained in:
@@ -60,4 +60,5 @@ const (
|
||||
streamKeysKey = "stream_keys"
|
||||
disableSearchIndexingKey = "disable_search_indexing"
|
||||
videoServingEndpointKey = "video_serving_endpoint"
|
||||
faviconPathKey = "favicon_path"
|
||||
)
|
||||
|
||||
@@ -129,4 +129,6 @@ type ConfigRepository interface {
|
||||
GetPrivateKey() string
|
||||
SetPublicKey(key string) error
|
||||
SetPrivateKey(key string) error
|
||||
GetFaviconPath() string
|
||||
SetFaviconPath(favicon string) error
|
||||
}
|
||||
|
||||
@@ -135,6 +135,22 @@ func (r *SqlConfigRepository) GetLogoUniquenessString() string {
|
||||
return uniqueness
|
||||
}
|
||||
|
||||
// GetFaviconPath will return the filename for the favicon in the data directory.
|
||||
func (r *SqlConfigRepository) GetFaviconPath() string {
|
||||
favicon, err := r.datastore.GetString(faviconPathKey)
|
||||
if err != nil {
|
||||
log.Traceln(faviconPathKey, err)
|
||||
return ""
|
||||
}
|
||||
|
||||
return favicon
|
||||
}
|
||||
|
||||
// SetFaviconPath will set the filename for the favicon in the data directory.
|
||||
func (r *SqlConfigRepository) SetFaviconPath(favicon string) error {
|
||||
return r.datastore.SetString(faviconPathKey, favicon)
|
||||
}
|
||||
|
||||
// GetServerSummary will return the server summary text.
|
||||
func (r *SqlConfigRepository) GetServerSummary() string {
|
||||
summary, err := r.datastore.GetString(serverSummaryKey)
|
||||
|
||||
Reference in New Issue
Block a user