media-organizer 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/filescanner.rb +6 -5
- data/lib/scrapers/image.rb +4 -1
- metadata +1 -1
data/lib/filescanner.rb
CHANGED
@@ -19,6 +19,7 @@ module MediaOrganizer
|
|
19
19
|
#This will return a list of all music and image files contained in /path/to/files/ and it's
|
20
20
|
class Filescanner
|
21
21
|
class FileNotValidError < StandardError ; end
|
22
|
+
class FileNotFoundError < StandardError ; end
|
22
23
|
|
23
24
|
|
24
25
|
attr_reader :root_nodes
|
@@ -93,13 +94,13 @@ module MediaOrganizer
|
|
93
94
|
#
|
94
95
|
#===Inputs
|
95
96
|
#
|
96
|
-
#
|
97
|
-
#
|
98
|
-
#
|
99
|
-
#
|
97
|
+
# @param [Hash] args Optional Arguments Hash:
|
98
|
+
# @option args [Symbol] :mode sets the mode to :single or :multiple
|
99
|
+
# @option args [Boolean] :music => (true, false) -- if true, music files will be included in the scan. Set to false to exclude music files. Defaults to true
|
100
|
+
# @option args [Boolean] :image => (true, false) -- if true, image files will be included in the scan. Set to false to exclude image files. Defaults to true
|
100
101
|
#
|
101
102
|
#===Outputs
|
102
|
-
#Array of strings, where each string is a file URI for a music or image file.
|
103
|
+
# @return [Array<String>] Array of strings, where each string is a file URI for a music or image file.
|
103
104
|
#
|
104
105
|
def multiscan(args = {})
|
105
106
|
@root_nodes.each do |uri|
|
data/lib/scrapers/image.rb
CHANGED
@@ -5,7 +5,10 @@ module MediaOrganizer
|
|
5
5
|
module Image
|
6
6
|
SUPPORTED_FILETYPES = %w{.jpg .tif}
|
7
7
|
class FileNotFoundError < StandardError ; end
|
8
|
-
|
8
|
+
#
|
9
|
+
# @param [String] file URI for the file from which to pull metadata
|
10
|
+
#
|
11
|
+
# @return [Hash] metadata fields associated with the file provided as input
|
9
12
|
def Image.getJpegData(file)
|
10
13
|
meta = EXIFR::JPEG.new(file)
|
11
14
|
return meta.to_hash
|