mediaman 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -22,11 +22,20 @@ module Mediaman
22
22
  end
23
23
  end
24
24
 
25
- desc "metadata <file>", "returns all the metadata discoverable about this file or directory"
25
+ desc "metadata <file/directory/title>", "returns all the metadata discoverable about this file, title, or directory"
26
26
  def metadata(path)
27
- doc = Document.from_path(path)
28
- doc.save_and_apply_metadata!
29
- puts "Metadata and image saved to #{doc.extras_path}"
27
+ path = File.expand_path path
28
+ if !File.exists?(path) && !File.directory?(path)
29
+ name = path
30
+ end
31
+ if name
32
+ doc = Mediaman::TemporaryDocument.from_name(name)
33
+ puts doc.metadata.stringify_keys.to_yaml
34
+ else
35
+ doc = Document.from_path(path)
36
+ doc.save_and_apply_metadata!
37
+ puts "Metadata and image saved to #{doc.extras_path}"
38
+ end
30
39
  end
31
40
 
32
41
  end
@@ -104,6 +104,7 @@ module Mediaman
104
104
  Metadata.new({'episode_details' => tv.to_hash, 'show_details' => tv.show.to_hash})
105
105
  end
106
106
  rescue
107
+ puts "TRAKT_API_KEY not set. Please set this environment variable to use remote metadata." unless ENV["TRAKT_API_KEY"]
107
108
  {}
108
109
  end
109
110
  end
@@ -1,3 +1,3 @@
1
1
  module Mediaman
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: mediaman
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.3
5
+ version: 0.0.4
6
6
  platform: ruby
7
7
  authors:
8
8
  - Wil Gieseler