Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
VideoLAN
VLC-iOS
Commits
c4818954
Commit
c4818954
authored
Mar 12, 2018
by
Pierre SAGASPE
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
plex : back of recovery the subtitles in plex library
(cherry picked from commit
493ad342
)
parent
eee1802d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
12 deletions
+36
-12
SharedSources/ServerBrowsing/Plex/VLCNetworkServerBrowserPlex.h
...Sources/ServerBrowsing/Plex/VLCNetworkServerBrowserPlex.h
+3
-1
SharedSources/ServerBrowsing/Plex/VLCNetworkServerBrowserPlex.m
...Sources/ServerBrowsing/Plex/VLCNetworkServerBrowserPlex.m
+33
-11
No files found.
SharedSources/ServerBrowsing/Plex/VLCNetworkServerBrowserPlex.h
View file @
c4818954
...
...
@@ -2,10 +2,11 @@
* VLCNetworkServerBrowserPlex.h
* VLC for iOS
*****************************************************************************
* Copyright (c) 2015 VideoLAN. All rights reserved.
* Copyright (c) 2015
-2018
VideoLAN. All rights reserved.
* $Id$
*
* Authors: Tobias Conradi <videolan # tobias-conradi.de>
* Pierre Sagaspe <pierre.sagaspe # me.com>
*
* Refer to the COPYING file of the official project for license.
*****************************************************************************/
...
...
@@ -30,6 +31,7 @@ NS_ASSUME_NONNULL_BEGIN
@property
(
nonatomic
,
readonly
,
nullable
)
NSString
*
duration
;
@property
(
nonatomic
,
readonly
,
nullable
)
NSURL
*
subtitleURL
;
@property
(
nonatomic
,
readonly
,
nullable
)
NSURL
*
thumbnailURL
;
@property
(
nonatomic
,
readonly
,
nullable
)
NSURL
*
URLcontainer
;
@property
(
nonatomic
,
getter
=
isDownloadable
,
readonly
)
BOOL
downloadable
;
@end
...
...
SharedSources/ServerBrowsing/Plex/VLCNetworkServerBrowserPlex.m
View file @
c4818954
...
...
@@ -2,10 +2,11 @@
* VLCNetworkServerBrowserPlex.m
* VLC for iOS
*****************************************************************************
* Copyright (c) 2015 VideoLAN. All rights reserved.
* Copyright (c) 2015
-2018
VideoLAN. All rights reserved.
* $Id$
*
* Authors: Tobias Conradi <videolan # tobias-conradi.de>
* Pierre Sagaspe <pierre.sagaspe # me.com>
*
* Refer to the COPYING file of the official project for license.
*****************************************************************************/
...
...
@@ -104,7 +105,16 @@
NSMutableArray
*
newItems
=
[
NSMutableArray
new
];
for
(
NSDictionary
*
dict
in
dicts
)
{
VLCNetworkServerBrowserItemPlex
*
item
=
[[
VLCNetworkServerBrowserItemPlex
alloc
]
initWithDictionary
:
dict
currentURL
:
url
authentificication
:
newAuth
];
[
newItems
addObject
:
item
];
/* warning: we make a http request per item and if the library is big or a weak network, it can slow down the process. */
if
(
item
.
URLcontainer
)
{
NSArray
*
dictItem
=
[
self
.
plexParser
PlexMediaServerParser
:
self
.
plexServerAddress
port
:
self
.
plexServerPort
navigationPath
:
item
.
URLcontainer
.
path
authentification
:
self
.
plexAuthentification
error
:&
error
];
for
(
NSDictionary
*
dictx
in
dictItem
)
{
item
=
[[
VLCNetworkServerBrowserItemPlex
alloc
]
initWithDictionary
:
dictx
currentURL
:
url
authentificication
:
newAuth
];
[
newItems
addObject
:
item
];
}
}
else
{
[
newItems
addObject
:
item
];
}
}
NSString
*
titleValue
=
firstObject
[
@"libTitle"
];
...
...
@@ -168,15 +178,28 @@
if
(
_container
)
{
NSString
*
keyPath
=
nil
;
NSString
*
keyValue
=
dictionary
[
@"key"
];
if
([
keyValue
rangeOfString
:
@"library"
].
location
==
NSNotFound
)
{
if
([
keyValue
rangeOfString
:
@"library"
].
location
==
NSNotFound
)
keyPath
=
[
path
stringByAppendingPathComponent
:
keyValue
];
}
else
{
else
keyPath
=
keyValue
;
}
if
(
keyPath
)
{
if
(
keyPath
)
urlPath
=
[
baseURL
URLByAppendingPathComponent
:
keyPath
].
absoluteString
;
}
}
else
{
NSString
*
keyPath
=
nil
;
NSString
*
keyValue
=
dictionary
[
@"key"
];
if
([
keyValue
rangeOfString
:
@"library"
].
location
==
NSNotFound
)
keyPath
=
[
path
stringByAppendingPathComponent
:
keyValue
];
else
keyPath
=
keyValue
;
if
(
keyPath
)
urlPath
=
[
baseURL
URLByAppendingPathComponent
:
keyPath
].
absoluteString
;
urlPath
=
[
VLCPlexWebAPI
urlAuth
:
urlPath
authentification
:
auth
];
_URLcontainer
=
[
NSURL
URLWithString
:
urlPath
];
urlPath
=
dictionary
[
@"keyMedia"
];
}
...
...
@@ -195,11 +218,10 @@
_filename
=
dictionary
[
@"namefile"
];
NSString
*
subtitleURLString
=
dictionary
[
@"keySubtitle"
];
if
(
subtitleURLString
)
{
if
(
subtitleURLString
)
subtitleURLString
=
[
VLCPlexWebAPI
urlAuth
:
subtitleURLString
authentification
:
auth
];
}
_subtitleURL
=
subtitleURLString
.
length
?
[
base
URL
URL
ByAppendingPathComponent
:
subtitleURLString
]
:
nil
;
_subtitleURL
=
subtitleURLString
.
length
?
[
NS
URL
URL
WithString
:
subtitleURLString
]
:
nil
;
}
return
self
;
}
...
...
@@ -227,4 +249,4 @@
return
[[
VLCNetworkServerBrowserPlex
alloc
]
initWithName
:
self
.
name
url
:
self
.
URL
auth
:
self
.
plexAuthentification
];
}
@end
\ No newline at end of file
@end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment