-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(device): Fix search not triggering segment download
Ref #27
- Loading branch information
Showing
4 changed files
with
121 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package device | ||
|
||
//go:generate stringer -type QueryState -linecomment | ||
|
||
type QueryState uint8 | ||
|
||
const ( | ||
QueryNone QueryState = iota // none | ||
QueryStarted // started | ||
QuerySuccess // success | ||
QueryFailed // failed | ||
) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package device | ||
|
||
type VideoMeta struct { | ||
CurrVideoId string | ||
CurrArtist string | ||
CurrTitle string | ||
|
||
PrevVideoId string | ||
PrevArtist string | ||
PrevTitle string | ||
} | ||
|
||
func (v *VideoMeta) Clear() { | ||
v.CurrVideoId = "" | ||
v.CurrArtist = "" | ||
v.CurrTitle = "" | ||
v.PrevVideoId = "" | ||
v.PrevArtist = "" | ||
v.PrevTitle = "" | ||
} | ||
|
||
func (v VideoMeta) Empty() bool { | ||
return v.CurrArtist == "" || v.CurrTitle == "" | ||
} | ||
|
||
func (v VideoMeta) SameVideo() bool { | ||
return v.CurrArtist == v.PrevArtist && v.CurrTitle == v.PrevTitle | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters