From 650862fafce9964f259d7937dc958379f633365f Mon Sep 17 00:00:00 2001 From: echel0n Date: Wed, 30 Jul 2014 15:34:05 -0700 Subject: [PATCH] Fix for updating/checkouts when using source files instead. --- sickbeard/versionChecker.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/sickbeard/versionChecker.py b/sickbeard/versionChecker.py index ced38a3c..62918abb 100644 --- a/sickbeard/versionChecker.py +++ b/sickbeard/versionChecker.py @@ -136,7 +136,10 @@ class WindowsUpdateManager(UpdateManager): def __init__(self): self.github_repo_user = self.get_github_repo_user() self.github_repo = self.get_github_repo() - self.branch = 'windows_binaries' + + self.branch = sickbeard.BRANCH + if sickbeard.BRANCH == '': + sickbeard.BRANCH = self.branch = self._find_installed_branch() self._cur_version = None self._cur_commit_hash = None @@ -155,6 +158,9 @@ class WindowsUpdateManager(UpdateManager): logger.log(u"Unknown SickRage Windows binary release: " + version, logger.ERROR) return None + def _find_installed_branch(self): + return 'windows_binaries' + def _find_newest_version(self, whole_link=False): """ Checks git for the newest Windows binary build. Returns either the @@ -281,8 +287,8 @@ class GitUpdateManager(UpdateManager): self.github_repo = self.get_github_repo() self.branch = sickbeard.BRANCH - if not sickbeard.BRANCH or sickbeard.BRANCH == '': - self.branch = self._find_installed_branch() + if sickbeard.BRANCH == '': + sickbeard.BRANCH = self.branch = self._find_installed_branch() self._cur_commit_hash = None self._newest_commit_hash = None @@ -539,8 +545,8 @@ class SourceUpdateManager(UpdateManager): self.github_repo = self.get_github_repo() self.branch = sickbeard.BRANCH - if not sickbeard.BRANCH or sickbeard.BRANCH == '': - self.branch = self._find_installed_branch() + if sickbeard.BRANCH == '': + sickbeard.BRANCH = self.branch = self._find_installed_branch() self._cur_commit_hash = None self._newest_commit_hash = None @@ -558,7 +564,7 @@ class SourceUpdateManager(UpdateManager): gh = github.GitHub(self.github_repo_user, self.github_repo, self.branch) for branch in gh.branches(): if branch.commit['sha'] == self._cur_commit_hash: - sickbeard.BRANCH = branch.name + return branch.name def need_update(self):