Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

unRARing possibly broke. Uses HTTPS. Support native m4v. Sliding view…

… does all items. Transfers that failed are not shown. Accounts popover fixed positions
  • Loading branch information...
commit 1c206c25f41295878337fd38b0e0fdb23540cf06 1 parent 4f1f174
@orta authored
View
1  Puttio/FileController/BaseFileController.m
@@ -43,7 +43,6 @@ - (void)secondaryButtonAction:(id)sender {}
-(NSString *)descriptiveTextForFile { return @"NO TEXT SET"; }
- (void)getInfoWithBlock:(void(^)(id infoObject))onComplete {
- NSLog(@"info!");
// [[PutIOClient sharedClient] getInfoForFile:_file :^(id userInfoObject) {
// NSLog(@"asdafsfAF");
// if (![userInfoObject isMemberOfClass:[NSError class]]) {
View
4 Puttio/FileController/ComicFileController.mm
@@ -69,7 +69,7 @@ - (NSString *)primaryButtonText {
- (void)primaryButtonAction:(id)sender {
[self markFileAsViewed];
- NSString *requestURL = [NSString stringWithFormat:@"http://put.io/v2/files/%@/download", _file.id];
+ NSString *requestURL = [NSString stringWithFormat:@"https://put.io/v2/files/%@/download", _file.id];
[self downloadFileAtPath:requestURL WithCompletionBlock:^(AFHTTPRequestOperation *operation, id responseObject) {
NSString *filePath = [NSTemporaryDirectory() stringByAppendingPathComponent:_file.id];
@@ -103,7 +103,7 @@ - (NSString *)secondaryButtonText {
}
- (void)secondaryButtonAction:(id)sender {
- NSString *requestURL = [NSString stringWithFormat:@"http://put.io/v2/files/%@/download", _file.id];
+ NSString *requestURL = [NSString stringWithFormat:@"https://put.io/v2/files/%@/download", _file.id];
[self downloadFileAtPath:requestURL WithCompletionBlock:^(AFHTTPRequestOperation *operation, id responseObject) {
NSString *filePath = [NSTemporaryDirectory() stringByAppendingPathComponent:_file.name];
View
2  Puttio/FileController/UnknownFileController.m
@@ -30,7 +30,7 @@ - (void)setFile:(File *)aFile {
[self.infoController showProgress];
[self.infoController disableButtons];
- NSString *requestURL = [NSString stringWithFormat:@"http://put.io/v2/files/%@/download", _file.id];
+ NSString *requestURL = [NSString stringWithFormat:@"https://put.io/v2/files/%@/download", _file.id];
[self downloadFileAtPath:requestURL WithCompletionBlock:^(AFHTTPRequestOperation *operation, id responseObject) {
downloadedFilepath = [NSTemporaryDirectory() stringByAppendingPathComponent:_file.name];
[operation.responseData writeToFile:downloadedFilepath atomically:YES];
View
8 Puttio/FileController/VideoFileController.m
@@ -62,9 +62,9 @@ - (NSString *)primaryButtonText {
- (void)primaryButtonAction:(id)sender {
if (_isMP4) {
- [MoviePlayer streamMovieAtPath:[NSString stringWithFormat:@"http://put.io/v2/files/%@/stream", _file.id]];
+ [MoviePlayer streamMovieAtPath:[NSString stringWithFormat:@"https://put.io/v2/files/%@/stream", _file.id]];
}else{
- [MoviePlayer streamMovieAtPath:[NSString stringWithFormat:@"http://put.io/v2/files/%@/mp4/stream", _file.id]];
+ [MoviePlayer streamMovieAtPath:[NSString stringWithFormat:@"https://put.io/v2/files/%@/mp4/stream", _file.id]];
}
[self markFileAsViewed];
@@ -90,9 +90,9 @@ - (void)secondaryButtonAction:(id)sender {
- (void)downloadFile {
NSString *requestURL;
if (_isMP4) {
- requestURL = [NSString stringWithFormat:@"http://put.io/v2/files/%@/download", _file.id];
+ requestURL = [NSString stringWithFormat:@"https://put.io/v2/files/%@/download", _file.id];
}else{
- requestURL = [NSString stringWithFormat:@"http://put.io/v2/files/%@/mp4/download", _file.id];
+ requestURL = [NSString stringWithFormat:@"https://put.io/v2/files/%@/mp4/download", _file.id];
}
[self downloadFileAtPath:requestURL WithCompletionBlock:^(AFHTTPRequestOperation *operation, id responseObject) {
View
7 Puttio/Models/Transfer.h
@@ -10,10 +10,17 @@
@interface Transfer : NSObject
+typedef enum {
+ TransferStatusOK,
+ TransferStatusERROR
+} TransferStatus;
+
+
@property (strong) NSNumber* estimatedTime;
@property (strong) NSString* name;
@property (strong) NSString* createdAt;
@property (strong) NSNumber* percentDone;
@property (strong) NSNumber* downloadSpeed;
@property (strong) NSString* displayName;
+@property (assign) TransferStatus status;
@end
View
2  Puttio/Networking/PutIONetworkConstants.m
@@ -15,4 +15,4 @@
NSString *const PTFormatOauthTokenURL = @"https://api.put.io/v2/oauth2/access_token?client_id=%@&client_secret=%@&grant_type=%@&redirect_uri=%@&code=%@";
NSString *const PTFormatOauthLoginURL = @"https://api.put.io/v2/oauth2/authenticate?client_id=%@&response_type=code&redirect_uri=%@";
-NSString *const PTFormatOauthURL = @"https://api.put.io/v2/oauth2/authenticate?client_id=%@&response_type=code&redirect_uri=%@";
+NSString *const PTFormatOauthURL = @"https://api.put.io/v2/oauth2/authenticate?client_id=%@&response_type=code&redirect_uri=%@";
View
4 Puttio/Networking/PutIOOAuthHelper.m
@@ -11,7 +11,7 @@
#import "AFNetworking.h"
#import "PutIONetworkConstants.h"
-// http://put.io/v2/docs/#authentication
+// https://put.io/v2/docs/#authentication
// The order of this is
@@ -42,7 +42,7 @@ - (void)loginWithUsername:(NSString *)username andPassword:(NSString *)password
- (void)getAccessTokenFromOauthCode:(NSString *)code {
// https://api.put.io/v2/oauth2/access_token?client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET&grant_type=authorization_code&redirect_uri=YOUR_REGISTERED_REDIRECT_URI&code=CODE
-
+ //
NSString *address = [NSString stringWithFormat:PTFormatOauthTokenURL, @"10", APP_SECRET, @"authorization_code", PTCallbackOriginal, code];
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:address]];
View
9 Puttio/Networking/V2PutIOAPIClient.m
@@ -6,7 +6,7 @@
// Copyright (c) 2012 ortatherox.com. All rights reserved.
//
-// http://put.io/v2/docs/
+// https://put.io/v2/docs/
#import "V2PutIOAPIClient.h"
#import "PutIONetworkConstants.h"
@@ -28,7 +28,7 @@ @implementation V2PutIOAPIClient
@synthesize apiToken, actionBlocks;
+ (id)setup {
- V2PutIOAPIClient *api = [[V2PutIOAPIClient alloc] initWithBaseURL:[NSURL URLWithString:@"http://api.put.io/"]];
+ V2PutIOAPIClient *api = [[V2PutIOAPIClient alloc] initWithBaseURL:[NSURL URLWithString:@"https://api.put.io/"]];
if (api) {
[[NSNotificationCenter defaultCenter] addObserver:api
@@ -155,6 +155,11 @@ - (void)getTransfers :(void(^)(id userInfoObject))onComplete {
transfer.estimatedTime = transferDict[@"estimated_time"];
transfer.createdAt = transferDict[@"created_at"];
transfer.displayName = [File createDisplayNameFromName:transfer.name];
+ if (transferDict[@"error_message"] != [NSNull null]) {
+ transfer.status = TransferStatusERROR;
+ }else {
+ transfer.status = TransferStatusOK;
+ }
[returnedTransfers addObject:transfer];
}
}
View
2  Puttio/Utils/V1PutIOAPIClient.m
@@ -10,7 +10,7 @@
#import "AFJSONRequestOperation.h"
#import "NSDictionary+JSON.h"
-// http://put.io/v2/docs/
+// https://put.io/v2/docs/
NSString* API_V1_ADDRESS = @"http://api.put.io/v1/";
@interface V1PutIOAPIClient ()
View
2  Puttio/ViewControllers/AccountViewController.m
@@ -39,7 +39,7 @@ - (void)viewWillAppear:(BOOL)animated {
// Space Left on Put.io
NSString *deviceUsedString = [[NSUserDefaults standardUserDefaults] objectForKey:ORDiskQuotaAvailableDefault];
- self.accountSpaceLabel.text = [NSString stringWithFormat:@"You are using %@ on the site", [UIDevice humanStringFromBytes:[deviceUsedString doubleValue]]];
+ self.accountSpaceLabel.text = [NSString stringWithFormat:@"You have %@ left on the site", [UIDevice humanStringFromBytes:[deviceUsedString doubleValue]]];
self.accountSpaceLeftProgress.progress = [[NSUserDefaults standardUserDefaults] doubleForKey:ORCurrentSpaceUsedPercentageDefault];
self.accountSpaceLeftProgress.isLandscape = YES;
View
9 Puttio/ViewControllers/StatusViewController.m
@@ -81,15 +81,14 @@ - (void)viewWillAppear:(BOOL)animated {
}
- (void)didTapProgressView:(UITapGestureRecognizer*)gesture {
-
- NSLog(@"ASDASD");
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:[NSBundle mainBundle]];
UIViewController *accountVC = [storyboard instantiateViewControllerWithIdentifier:@"accountView"];
popoverController = [[WEPopoverController alloc] initWithContentViewController:accountVC];
-
- [popoverController presentPopoverFromRect:gesture.view.superview.frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionRight animated:YES];
+ UINavigationController *rootController = (UINavigationController*)[UIApplication sharedApplication].keyWindow.rootViewController;
+
+ [popoverController presentPopoverFromRect:[rootController.view convertRect:gesture.view.frame fromView:gesture.view.superview] inView:rootController.view permittedArrowDirections:UIPopoverArrowDirectionRight animated:YES];
}
- (void)startTimer {
@@ -125,6 +124,8 @@ - (NSArray *)onlyRecentTransfers: (NSArray*)inTransfers {
NSDate *threeDaysAgo = [calendar dateByAddingComponents:minusDaysComponents toDate:today options:0];
for (Transfer *transfer in inTransfers) {
+ if (transfer.status == TransferStatusERROR) continue;
+
if (transfer.percentDone.intValue != 100) {
[newTransfers addObject:transfer];
}else{
View
3  Puttio/Views/ORSlidingTableView.m
@@ -55,7 +55,7 @@ - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
}
// loop through all the cells subtracting the height
- for (cellIndex = 0; cellIndex < cellCount - 1; cellIndex++) {
+ for (cellIndex = 0; cellIndex < cellCount; cellIndex++) {
fingerY -= cellHeight;
if (fingerY < 0) break;
}
@@ -78,5 +78,4 @@ - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
[self.slidingDelegate slidingTableDidEndTouch:self];
}
-
@end
View
4 Puttio/en.lproj/MainStoryboard.storyboard
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="2.0" toolsVersion="2541" systemVersion="12A248" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" initialViewController="VQ5-Rz-QCj">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="2.0" toolsVersion="2809" systemVersion="11E53" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" initialViewController="VQ5-Rz-QCj">
<dependencies>
<deployment version="1280" identifier="iOS"/>
- <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="1875"/>
+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="1884"/>
</dependencies>
<scenes>
<!--Navigation Controller-->
View
4 vendor/UnRAR/unrarsrc-3.9.10/os.hpp
@@ -166,8 +166,8 @@
#else
#endif
-#include <pwd.h>
-#include <grp.h>
+//#include <pwd.h>
+//#include <grp.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
View
114 vendor/UnRAR/unrarsrc-3.9.10/uowners.cpp
@@ -8,35 +8,35 @@ void ExtractUnixOwner(Archive &Arc,char *FileName)
ErrHandler.SetErrorCode(CRC_ERROR);
return;
}
-
- struct passwd *pw;
- if ((pw=getpwnam(Arc.UOHead.OwnerName))==NULL)
- {
- Log(Arc.FileName,St(MErrGetOwnerID),Arc.UOHead.OwnerName);
- ErrHandler.SetErrorCode(WARNING);
- return;
- }
- uid_t OwnerID=pw->pw_uid;
-
- struct group *gr;
- if ((gr=getgrnam(Arc.UOHead.GroupName))==NULL)
- {
- Log(Arc.FileName,St(MErrGetGroupID),Arc.UOHead.GroupName);
- ErrHandler.SetErrorCode(CRC_ERROR);
- return;
- }
- uint Attr=GetFileAttr(FileName,NULL);
- gid_t GroupID=gr->gr_gid;
-#if defined(SAVE_LINKS) && !defined(_APPLE)
- if (lchown(FileName,OwnerID,GroupID)!=0)
-#else
- if (chown(FileName,OwnerID,GroupID)!=0)
-#endif
- {
- Log(Arc.FileName,St(MSetOwnersError),FileName);
- ErrHandler.SetErrorCode(CREATE_ERROR);
- }
- SetFileAttr(FileName,NULL,Attr);
+//
+// struct passwd *pw;
+// if ((pw=getpwnam(Arc.UOHead.OwnerName))==NULL)
+// {
+// Log(Arc.FileName,St(MErrGetOwnerID),Arc.UOHead.OwnerName);
+// ErrHandler.SetErrorCode(WARNING);
+// return;
+// }
+// uid_t OwnerID=pw->pw_uid;
+//
+// struct group *gr;
+// if ((gr=getgrnam(Arc.UOHead.GroupName))==NULL)
+// {
+// Log(Arc.FileName,St(MErrGetGroupID),Arc.UOHead.GroupName);
+// ErrHandler.SetErrorCode(CRC_ERROR);
+// return;
+// }
+// uint Attr=GetFileAttr(FileName,NULL);
+// gid_t GroupID=gr->gr_gid;
+//#if defined(SAVE_LINKS) && !defined(_APPLE)
+// if (lchown(FileName,OwnerID,GroupID)!=0)
+//#else
+// if (chown(FileName,OwnerID,GroupID)!=0)
+//#endif
+// {
+// Log(Arc.FileName,St(MSetOwnersError),FileName);
+// ErrHandler.SetErrorCode(CREATE_ERROR);
+// }
+// SetFileAttr(FileName,NULL,Attr);
}
@@ -49,32 +49,32 @@ void ExtractUnixOwnerNew(Archive &Arc,char *FileName)
strncpy(GroupName,(char *)&Arc.SubHead.SubData[OwnerSize],GroupSize);
GroupName[GroupSize]=0;
- struct passwd *pw;
- if ((pw=getpwnam(OwnerName))==NULL)
- {
- Log(Arc.FileName,St(MErrGetOwnerID),OwnerName);
- ErrHandler.SetErrorCode(WARNING);
- return;
- }
- uid_t OwnerID=pw->pw_uid;
-
- struct group *gr;
- if ((gr=getgrnam(GroupName))==NULL)
- {
- Log(Arc.FileName,St(MErrGetGroupID),GroupName);
- ErrHandler.SetErrorCode(CRC_ERROR);
- return;
- }
- uint Attr=GetFileAttr(FileName,NULL);
- gid_t GroupID=gr->gr_gid;
-#if defined(SAVE_LINKS) && !defined(_APPLE)
- if (lchown(FileName,OwnerID,GroupID)!=0)
-#else
- if (chown(FileName,OwnerID,GroupID)!=0)
-#endif
- {
- Log(Arc.FileName,St(MSetOwnersError),FileName);
- ErrHandler.SetErrorCode(CREATE_ERROR);
- }
- SetFileAttr(FileName,NULL,Attr);
+// struct passwd *pw;
+// if ((pw=getpwnam(OwnerName))==NULL)
+// {
+// Log(Arc.FileName,St(MErrGetOwnerID),OwnerName);
+// ErrHandler.SetErrorCode(WARNING);
+// return;
+// }
+// uid_t OwnerID=pw->pw_uid;
+//
+// struct group *gr;
+// if ((gr=getgrnam(GroupName))==NULL)
+// {
+// Log(Arc.FileName,St(MErrGetGroupID),GroupName);
+// ErrHandler.SetErrorCode(CRC_ERROR);
+// return;
+// }
+// uint Attr=GetFileAttr(FileName,NULL);
+// gid_t GroupID=gr->gr_gid;
+//#if defined(SAVE_LINKS) && !defined(_APPLE)
+// if (lchown(FileName,OwnerID,GroupID)!=0)
+//#else
+// if (chown(FileName,OwnerID,GroupID)!=0)
+//#endif
+// {
+// Log(Arc.FileName,St(MSetOwnersError),FileName);
+// ErrHandler.SetErrorCode(CREATE_ERROR);
+// }
+// SetFileAttr(FileName,NULL,Attr);
}
Please sign in to comment.
Something went wrong with that request. Please try again.