mirror of
https://github.com/stashapp/stash.git
synced 2025-12-06 08:26:00 +01:00
* Open stash in system tray on Windows/MacOS * Add desktop notifications * MacOS Bundling * Add binary icon Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
28 lines
492 B
Go
28 lines
492 B
Go
package api
|
|
|
|
import (
|
|
"embed"
|
|
"runtime"
|
|
)
|
|
|
|
const faviconDir = "ui/v2.5/build/"
|
|
|
|
type FaviconProvider struct {
|
|
uiBox embed.FS
|
|
}
|
|
|
|
func (p *FaviconProvider) GetFavicon() []byte {
|
|
if runtime.GOOS == "windows" {
|
|
faviconPath := faviconDir + "favicon.ico"
|
|
ret, _ := p.uiBox.ReadFile(faviconPath)
|
|
return ret
|
|
}
|
|
|
|
return p.GetFaviconPng()
|
|
}
|
|
|
|
func (p *FaviconProvider) GetFaviconPng() []byte {
|
|
faviconPath := faviconDir + "favicon.png"
|
|
ret, _ := p.uiBox.ReadFile(faviconPath)
|
|
return ret
|
|
}
|