mirror of
https://github.com/AynaLivePlayer/AynaLivePlayer.git
synced 2025-12-13 13:38:16 +08:00
add empty image output
This commit is contained in:
@@ -6,7 +6,7 @@ import (
|
|||||||
"path"
|
"path"
|
||||||
)
|
)
|
||||||
|
|
||||||
const VERSION = "alpha 0.8.0"
|
const VERSION = "alpha 0.8.1"
|
||||||
|
|
||||||
const CONFIG_PATH = "./config.ini"
|
const CONFIG_PATH = "./config.ini"
|
||||||
const Assests_PATH = "./assets"
|
const Assests_PATH = "./assets"
|
||||||
|
|||||||
@@ -55,14 +55,16 @@ type OutInfo struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type TextInfo struct {
|
type TextInfo struct {
|
||||||
Rendering bool
|
Rendering bool
|
||||||
info OutInfo
|
info OutInfo
|
||||||
templates []*Template
|
templates []*Template
|
||||||
panel fyne.CanvasObject
|
emptyCover []byte
|
||||||
|
panel fyne.CanvasObject
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewTextInfo() *TextInfo {
|
func NewTextInfo() *TextInfo {
|
||||||
return &TextInfo{Rendering: true}
|
b, _ := ioutil.ReadFile(config.GetAssetPath("empty.png"))
|
||||||
|
return &TextInfo{Rendering: true, emptyCover: b}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *TextInfo) Title() string {
|
func (t *TextInfo) Title() string {
|
||||||
@@ -166,6 +168,10 @@ func (t *TextInfo) OutputCover() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if !t.info.Current.Cover.Exists() {
|
if !t.info.Current.Cover.Exists() {
|
||||||
|
err := ioutil.WriteFile(filepath.Join(Out_Path, "cover.jpg"), t.emptyCover, 0666)
|
||||||
|
if err != nil {
|
||||||
|
l().Warnf("write cover file failed: %s", err)
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if t.info.Current.Cover.Data != nil {
|
if t.info.Current.Cover.Data != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user