Skip to content

Commit

Permalink
Simplify notifications and remove xid dep part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
kivutar committed Nov 1, 2019
1 parent d9a2c05 commit 9946105
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions ludos/releases.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ func DownloadRelease(path, url string) {
return
}

nid := ntf.DisplayAndLog(ntf.Info, "Menu", "Downloading update 0%%")
n := ntf.DisplayAndLog(ntf.Info, "Menu", "Downloading update 0%%")
downloading = true
defer func() { downloading = false }()

req, err := grab.NewRequest(path, url)
if err != nil {
ntf.Update(nid, ntf.Error, err.Error())
n.Update(ntf.Error, err.Error())
return
}

Expand All @@ -84,7 +84,7 @@ Loop:
for {
select {
case <-t.C:
ntf.Update(nid, ntf.Info, "Downloading update %.0f%%%% ", 100*resp.Progress())
n.Update(ntf.Info, "Downloading update %.0f%%%% ", 100*resp.Progress())
progress = resp.Progress()

case <-resp.Done:
Expand All @@ -96,13 +96,13 @@ Loop:
}

if err := resp.Err(); err != nil {
ntf.Update(nid, ntf.Error, err.Error())
n.Update(ntf.Error, err.Error())
downloading = false
done = false
return
}

ntf.Update(nid, ntf.Success, "Done downloading. You can now reboot your system.")
n.Update(ntf.Success, "Done downloading. You can now reboot your system.")
}

// IsDownloading returns true if the updater is currently downloading a release
Expand Down
2 changes: 1 addition & 1 deletion scanner/scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func ScanDir(dir string, doneCb func()) {
}

// Scan scans a list of roms against the database
func Scan(dir string, roms []string, games chan (rdb.Game), n ntf.Notification) {
func Scan(dir string, roms []string, games chan (rdb.Game), n *ntf.Notification) {
for i, f := range roms {
ext := filepath.Ext(f)
switch ext {
Expand Down

0 comments on commit 9946105

Please sign in to comment.