diff --git a/Controller.h b/Controller.h
index 4f22f6e..438c76f 100644
--- a/Controller.h
+++ b/Controller.h
@@ -71,8 +71,6 @@
- (void)downloadShowListDidFinish: (NSNotification *)notification;
// Setters/getters
-- (NSArray *)qualities;
-- (void)setQualities: (NSArray *)someQualities;
- (NSDictionary *)shows;
- (void)setShows: (NSDictionary *)someShows;
- (NSArray *)details;
diff --git a/Helper.m b/Helper.m
index 0ae5955..4cb1ca3 100644
--- a/Helper.m
+++ b/Helper.m
@@ -146,15 +146,15 @@ - (id) init {
[self chmodFolderAtPath:launchAgentsFolder];
// Remove scriptFolder if we have a newer version to install
- if ( [fm fileExistsAtPath:scriptPath] ) {
+ if ([fm fileExistsAtPath:scriptPath]) {
NSString *scriptVersion = [[NSUserDefaults standardUserDefaults] objectForKey:@"ScriptVersion"];
- if ( !scriptVersion || NSOrderedAscending == [scriptVersion compare:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"] options:NSNumericSearch] )
- if ( ![fm removeFileAtPath:scriptFolder handler:nil] )
+ if (!scriptVersion || [scriptVersion compare:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"] options:NSCaseInsensitiveSearch] )
+ if (![fm removeFileAtPath:scriptFolder handler:nil])
[Helper dieWithErrorMessage:@"Could not remove the TVShows script folder in the Application Support folder in order to install the new one."];
}
// Install the script in the Application Support folder
- if ( ![fm fileExistsAtPath:scriptFolder] ) {
+ if (![fm fileExistsAtPath:scriptFolder]) {
if ( ![fm copyPath:resourcesScriptFolder toPath:scriptFolder handler:nil] ) {
[Helper dieWithErrorMessage:@"Could not copy the TVShows script in the Application Support folder."];
} else {
diff --git a/Info.plist b/Info.plist
index f3d6418..8b0c65c 100644
--- a/Info.plist
+++ b/Info.plist
@@ -17,7 +17,7 @@
CFBundlePackageType
APPL
CFBundleShortVersionString
- ${CURRENT_PROJECT_VERSION}
+ ${CURRENT_BUNDLE_SHORT}
CFBundleSignature
????
CFBundleVersion
diff --git a/TVShows.xcodeproj/project.pbxproj b/TVShows.xcodeproj/project.pbxproj
index bd49393..4f8dcda 100644
--- a/TVShows.xcodeproj/project.pbxproj
+++ b/TVShows.xcodeproj/project.pbxproj
@@ -274,7 +274,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /usr/bin/ruby;
- shellScript = "if ENV[\"CONFIGURATION\"] == \"Release\" then\n\tfolder = \"#{ENV[\"TARGET_BUILD_DIR\"]}\"\n\tfile = \"#{ENV[\"TARGET_NAME\"]}_#{ENV[\"CURRENT_PROJECT_VERSION\"]}.zip\"\n\tappname = \"#{ENV[\"TARGET_NAME\"]}_#{ENV[\"CURRENT_PROJECT_VERSION\"]}\"\n\tpath = File.join(folder,file)\n#\t`mv \"#{folder}/TVShows\" ~/.Trash`\n#\t`mv #{folder}/*.zip ~/.Trash`\n#\t`mv #{folder}/appcast.xml ~/.Trash`\n\t`mkdir \"#{folder}/#{appname}\"`\n\t`cp \"#{File.join(ENV[\"PROJECT_DIR\"],\"..\",\"utils\",\"uninstall.sh\")}\" \"#{folder}/#{appname}\"`\n\t`mv \"#{folder}/#{ENV[\"FULL_PRODUCT_NAME\"]}\" \"#{folder}/#{appname}\"`\n\t`cd \"#{folder}\" && zip -qr \"#{file}\" #{appname}`\n\tkey = `openssl dgst -sha1 -binary < \"#{path}\" | openssl dgst -dss1 -sign \"#{File.join(\"#{ENV[\"PROJECT_DIR\"]}\",\"..\",\"appcast\",\"dsa_priv.pem\")}\" | openssl enc -base64`\n\tkey = key.split(\"\\n\").first\n\tFile.open(\"#{folder}/appcast.xml\", \"w\") { |f|\n\t\tf << \"- \\n\"\n\t\tf << \"\\tTVShows #{ENV[\"CURRENT_PROJECT_VERSION\"]}\\n\"\n\t\tf << \"\\t#{Time.now}\\n\"\n\t\tf << \"\\t\\n\"\n\t\tf << \"\\tTVShows #{ENV[\"CURRENT_PROJECT_VERSION\"]}\\n\"\n\t\tf << \"\\t\\t
\\n\"\n\t\tf << \"\\t\\tChanges:
\\n\"\n\t\tf << \"\\t\\t\\n\"\n\t\tf << \"\\t\\t\\t\\n\"\n\t\tf << \"\\t\\t\\t\\n\"\n\t\tf << \"\\t\\t\\t\\n\"\n\t\tf << \"\\t\\t
\\n\\t]]>\\n\"\n\t\tf << \" \"\n\t}\nend\n\n";
+ shellScript = "if ENV[\"CONFIGURATION\"] == \"Release\" then\n\tfolder = \"#{ENV[\"TARGET_BUILD_DIR\"]}\"\n\tfile = \"#{ENV[\"TARGET_NAME\"]}_#{ENV[\"CURRENT_BUNDLE_SHORT\"]}.zip\"\n\tappname = \"#{ENV[\"TARGET_NAME\"]}_#{ENV[\"CURRENT_BUNDLE_SHORT\"]}\"\n\tpath = File.join(folder,file)\n#\t`mv \"#{folder}/TVShows\" ~/.Trash`\n#\t`mv #{folder}/*.zip ~/.Trash`\n#\t`mv #{folder}/appcast.xml ~/.Trash`\n\t`mkdir \"#{folder}/#{appname}\"`\n\t`cp \"#{File.join(ENV[\"PROJECT_DIR\"],\"..\",\"utils\",\"uninstall.sh\")}\" \"#{folder}/#{appname}\"`\n\t`mv \"#{folder}/#{ENV[\"FULL_PRODUCT_NAME\"]}\" \"#{folder}/#{appname}\"`\n\t`cd \"#{folder}\" && zip -qr \"#{file}\" #{appname}`\n\tkey = `openssl dgst -sha1 -binary < \"#{path}\" | openssl dgst -dss1 -sign \"#{File.join(\"#{ENV[\"PROJECT_DIR\"]}\",\"..\",\"appcast\",\"dsa_priv.pem\")}\" | openssl enc -base64`\n\tkey = key.split(\"\\n\").first\n\tFile.open(\"#{folder}/appcast.xml\", \"w\") { |f|\n\t\tf << \"- \\n\"\n\t\tf << \"\\tTVShows #{ENV[\"CURRENT_BUNDLE_SHORT\"]}\\n\"\n\t\tf << \"\\t#{Time.now}\\n\"\n\t\tf << \"\\t\\n\"\n\t\tf << \"\\tTVShows #{ENV[\"CURRENT_BUNDLE_SHORT\"]}\\n\"\n\t\tf << \"\\t\\t
\\n\"\n\t\tf << \"\\t\\tChanges:
\\n\"\n\t\tf << \"\\t\\t\\n\"\n\t\tf << \"\\t\\t\\t\\n\"\n\t\tf << \"\\t\\t\\t\\n\"\n\t\tf << \"\\t\\t\\t\\n\"\n\t\tf << \"\\t\\t
\\n\\t]]>\\n\"\n\t\tf << \" \"\n\t}\nend";
};
/* End PBXShellScriptBuildPhase section */
@@ -386,6 +386,7 @@
C01FCF4F08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ CURRENT_BUNDLE_SHORT = 0.4.3b;
CURRENT_PROJECT_VERSION = 0.4.2;
GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
@@ -393,18 +394,21 @@
IBC_STRIP_NIBS = NO;
PREBINDING = NO;
SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
+ VERSIONING_SYSTEM = "apple-generic";
};
name = Debug;
};
C01FCF5008A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ CURRENT_BUNDLE_SHORT = 0.4.3b;
CURRENT_PROJECT_VERSION = 0.4.2;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- IBC_STRIP_NIBS = NO;
+ IBC_STRIP_NIBS = YES;
PREBINDING = NO;
SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
+ VERSIONING_SYSTEM = "apple-generic";
};
name = Release;
};
diff --git a/TVShowsScript/TVShows.rb b/TVShowsScript/TVShows.rb
index 9dea239..59875ea 100755
--- a/TVShowsScript/TVShows.rb
+++ b/TVShowsScript/TVShows.rb
@@ -51,7 +51,7 @@ class Episode
def initialize(show,torrentURL,publishedTime)
@show = show
- @torrentURL = URI.encode(torrentURL,"[]")
+ @torrentURL = torrentURL.gsub(/\[/, '%5B').gsub(/\]/, '%5D')
@publishedTime = publishedTime
end