Skip to content

Commit

Permalink
added user version check
Browse files Browse the repository at this point in the history
  • Loading branch information
danielwestendorf committed Dec 13, 2011
1 parent ee025e3 commit 71848a7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Thumper.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@
827CE5B91347B49D00170589 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0410;
LastUpgradeCheck = 0420;
ORGANIZATIONNAME = "Daniel Westendorf";
};
buildConfigurationList = 827CE5BC1347B49D00170589 /* Build configuration list for PBXProject "Thumper" */;
Expand Down
Binary file not shown.
8 changes: 7 additions & 1 deletion Thumper/Classes/Subsonic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -355,10 +355,16 @@ def getUserResponse(xml, options)
user = xml.nodesForXPath("subsonic-response", error:nil).first.nodesForXPath('user', error:nil).first
#user.attributeForName("scrobblingEnabled").stringValue == "true" ? @parent.scrobbling_enabled = true : @parent.scrobbling_enabled = false
user.attributeForName("downloadRole").stringValue == "true" ? @parent.downloading_enabled = true : @parent.downloading_enabled = false
user.attributeForName("shareRole").stringValue == "true" ? @parent.sharing_enabled = true : @parent.sharing_enabled = false
user.attributeForName("shareRole") && user.attributeForName("shareRole").stringValue == "true" ? @parent.sharing_enabled = true : @parent.sharing_enabled = false
NSLog "Sharing is not enabled for #{@username}" unless @parent.sharing_enabled
NSLog "Downloading is not enabled for #{@username}" unless @parent.downloading_enabled
#NSLog "Scrobbling is not enabled for #{@username}" unless @parent.scrobbling_enabled

if xml.nodesForXPath('subsonic-response', error:nil).first.attributeForName(:version).stringValue.to_f < 1.7
NSLog "Transcoding not supported, upgrade your Subsonic instance to at least 4.6. Current API Version: #{xml.nodesForXPath('subsonic-response', error:nil).first.attributeForName(:version).stringValue.to_f}"
@parent.bitrate = 0
@parent.bitrate_field.setEnabled(false)
end
end
end

Expand Down

0 comments on commit 71848a7

Please sign in to comment.