Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Watched state management refactor #31

Merged
merged 1 commit into from
Apr 12, 2017

Conversation

elgatito
Copy link

@elgatito elgatito commented Apr 7, 2017

  • Processing Watched progress state in torrentfs Close() to be sure we save progress for any played item.
  • Removed Player.onStop notification processor as Kodi seems to send sometimes wrong IDs (depends on ListItem parameters, while we surely know what we play).
  • Moved all that to separate Library package, moved Infolabels also there
  • When Item is started from Quasar - it's Watching state gets synchronized with Kodi library.

@scakemyer
Copy link
Owner

All additions are using spaces for indentation...

"regexp"
"strconv"
"strings"
"time"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please follow the visual order for imports

"github.com/scakemyer/quasar/config"
"github.com/scakemyer/quasar/diskusage"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those imports were ordered properly

libtorrent.AlertErrorNotification))
libtorrent.AlertStatusNotification|
libtorrent.AlertStorageNotification|
libtorrent.AlertErrorNotification))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation and space before | was fine here

case libtorrent.ExternalIpAlertAlertType:
splitMessage := strings.Split(alertMessage, ":")
splitIP := strings.Split(splitMessage[len(splitMessage)-1], ".")
alertMessage = strings.Join(splitMessage[:len(splitMessage)-1], ":") + splitIP[0] + ".XX.XX.XX"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spaces around -

"sync"
"time"
"unsafe"
"encoding/hex"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import order...

@elgatito elgatito force-pushed the watched_refactor branch 2 times, most recently from 5b6fff2 to dab905d Compare April 10, 2017 04:42
@elgatito
Copy link
Author

Commit updated

api/watcher.go Outdated
)

var (
watcherLog = logging.MustGetLogger("watcher")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Single space after watcherLog here

@@ -313,7 +319,7 @@ func (s *BTService) configure() {
settings.SetBool(libtorrent.SettingByName("use_read_cache"), true)
settings.SetBool(libtorrent.SettingByName("coalesce_reads"), true)
settings.SetBool(libtorrent.SettingByName("coalesce_writes"), true)
settings.SetInt(libtorrent.SettingByName("max_queued_disk_bytes"), 10 * 1024 * 1024)
settings.SetInt(libtorrent.SettingByName("max_queued_disk_bytes"), 10*1024*1024)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bring back those shpaces pleagzes

"path/filepath"
"sync"
"time"
"unsafe"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import order was fine here, encoding/hex would go just before path/filepath and that's it

@elgatito
Copy link
Author

Updated with fixes.

@scakemyer scakemyer merged commit 58c8fc6 into scakemyer:master Apr 12, 2017
@elgatito elgatito deleted the watched_refactor branch December 8, 2017 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants