diff --git a/Plugins/Shorten/ShortenDecoder.mm b/Plugins/Shorten/ShortenDecoder.mm index a5e2bf13c..e728547c9 100644 --- a/Plugins/Shorten/ShortenDecoder.mm +++ b/Plugins/Shorten/ShortenDecoder.mm @@ -10,8 +10,14 @@ @implementation ShortenDecoder -- (BOOL)open:(NSURL *)url +- (BOOL)open:(id)source { + NSURL *url = [source url]; + if (![[url scheme] isEqualToString:@"file"]) + return NO; + + [source close]; + decoder = new shn_reader; if (!decoder) @@ -124,6 +130,10 @@ shn_unload(handle);*/ } +- (BOOL)seekable +{ + return YES; +} - (NSDictionary *)properties { diff --git a/Plugins/Shorten/ShortenPropertiesReader.mm b/Plugins/Shorten/ShortenPropertiesReader.mm index 797db4ba9..92ddf7d34 100644 --- a/Plugins/Shorten/ShortenPropertiesReader.mm +++ b/Plugins/Shorten/ShortenPropertiesReader.mm @@ -11,13 +11,13 @@ @implementation ShortenPropertiesReader -- (NSDictionary *)propertiesForURL:(NSURL *)url ++ (NSDictionary *)propertiesForSource:(id)source { NSDictionary *properties; ShortenDecoder *decoder; decoder = [[ShortenDecoder alloc] init]; - if (![decoder open:url]) + if (![decoder open:source]) { return nil; }