lrcat 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +52 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +39 -0
- data/Rakefile +1 -0
- data/lib/lrcat.rb +5 -0
- data/lib/lrcat/catalog.rb +35 -0
- data/lib/lrcat/catalog/camera_model.rb +13 -0
- data/lib/lrcat/catalog/camera_serial.rb +13 -0
- data/lib/lrcat/catalog/develop_settings.rb +12 -0
- data/lib/lrcat/catalog/exif_metadata.rb +15 -0
- data/lib/lrcat/catalog/image.rb +15 -0
- data/lib/lrcat/catalog/lens.rb +13 -0
- data/lib/lrcat/catalog/library_file.rb +14 -0
- data/lib/lrcat/catalog/library_folder.rb +14 -0
- data/lib/lrcat/catalog/library_root_folder.rb +12 -0
- data/lib/lrcat/version.rb +3 -0
- data/lrcat.gemspec +26 -0
- metadata +119 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 1f4b3587164ec1022a8302bf7b5b148cf193a173
|
4
|
+
data.tar.gz: 0cdd78f1459d4327971d0b89d613002d71cb8925
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: e8feb3fe58f6f61d2879cab7445a86bf078f658f3385f9f0ed3ad4c3c5de8baa3806f3cebcd9c4f30a69ee14bad77a693551ef49a10a33ec281ade4fcfc438a9
|
7
|
+
data.tar.gz: 968c9e04e83c66457b621bdc66edc5a44a00aee127cf650d210018cecb6ce9244997f40b5ac0b23cf23d70883696707cc86170e8a1f3fe49050a0d6f957c848d
|
data/.gitignore
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
.bundle
|
4
|
+
.config
|
5
|
+
.yardoc
|
6
|
+
Gemfile.lock
|
7
|
+
InstalledFiles
|
8
|
+
_yardoc
|
9
|
+
coverage
|
10
|
+
doc/
|
11
|
+
lib/bundler/man
|
12
|
+
pkg
|
13
|
+
rdoc
|
14
|
+
spec/reports
|
15
|
+
test/tmp
|
16
|
+
test/version_tmp
|
17
|
+
tmp
|
18
|
+
# Created by http://gitignore.io
|
19
|
+
|
20
|
+
### OSX ###
|
21
|
+
.DS_Store
|
22
|
+
.AppleDouble
|
23
|
+
.LSOverride
|
24
|
+
Icon
|
25
|
+
|
26
|
+
|
27
|
+
# Thumbnails
|
28
|
+
._*
|
29
|
+
|
30
|
+
# Files that might appear on external disk
|
31
|
+
.Spotlight-V100
|
32
|
+
.Trashes
|
33
|
+
|
34
|
+
### Ruby ###
|
35
|
+
*.gem
|
36
|
+
*.rbc
|
37
|
+
.bundle
|
38
|
+
.config
|
39
|
+
coverage
|
40
|
+
InstalledFiles
|
41
|
+
lib/bundler/man
|
42
|
+
pkg
|
43
|
+
rdoc
|
44
|
+
spec/reports
|
45
|
+
test/tmp
|
46
|
+
test/version_tmp
|
47
|
+
tmp
|
48
|
+
|
49
|
+
# YARD artifacts
|
50
|
+
.yardoc
|
51
|
+
_yardoc
|
52
|
+
doc/
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Maxime Mouchet
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
# Lrcat.rb
|
2
|
+
|
3
|
+
ActiveRecord mappings for the Lightroom Catalog.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'lrcat'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install lrcat
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
```ruby
|
22
|
+
require 'lrcat'
|
23
|
+
|
24
|
+
# Open the catalog. (Please make a backup, this is experimental)
|
25
|
+
Lrcat::Catalog.open('Lightroom 5 Catalog.lrcat')
|
26
|
+
|
27
|
+
# Print the number of photos/camera model.
|
28
|
+
Lrcat::Catalog::CameraModel.all.each do |camera_model|
|
29
|
+
puts "#{ camera_model.value } : #{ camera_model.images.count }"
|
30
|
+
end
|
31
|
+
```
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
1. Fork it
|
36
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
37
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
38
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
39
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'bundler/gem_tasks'
|
data/lib/lrcat.rb
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'active_record'
|
2
|
+
require 'sqlite3'
|
3
|
+
|
4
|
+
require 'lrcat/catalog/library_file'
|
5
|
+
require 'lrcat/catalog/library_folder'
|
6
|
+
require 'lrcat/catalog/library_root_folder'
|
7
|
+
|
8
|
+
require 'lrcat/catalog/image'
|
9
|
+
require 'lrcat/catalog/exif_metadata'
|
10
|
+
require 'lrcat/catalog/develop_settings'
|
11
|
+
|
12
|
+
require 'lrcat/catalog/lens'
|
13
|
+
require 'lrcat/catalog/camera_model'
|
14
|
+
require 'lrcat/catalog/camera_serial'
|
15
|
+
|
16
|
+
module Lrcat
|
17
|
+
|
18
|
+
# The Catalog module takes care of the ActiveRecord connection and
|
19
|
+
# contains the ActiveRecord models.
|
20
|
+
module Catalog
|
21
|
+
|
22
|
+
# Establish the connection to the catalog.
|
23
|
+
#
|
24
|
+
# @param path [String] the path to the catalog file.
|
25
|
+
def self.open(path)
|
26
|
+
ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: path)
|
27
|
+
end
|
28
|
+
|
29
|
+
# Close the connection.
|
30
|
+
def self.close
|
31
|
+
ActiveRecord::Base.remove_connection
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module Lrcat
|
2
|
+
module Catalog
|
3
|
+
|
4
|
+
class CameraModel < ActiveRecord::Base
|
5
|
+
self.table_name = 'AgInternedExifCameraModel'
|
6
|
+
self.primary_key = 'id_local'
|
7
|
+
|
8
|
+
has_many :exif_metadatas, foreign_key: 'cameraModelRef'
|
9
|
+
has_many :images, through: :exif_metadatas
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module Lrcat
|
2
|
+
module Catalog
|
3
|
+
|
4
|
+
class CameraSerial < ActiveRecord::Base
|
5
|
+
self.table_name = 'AgInternedExifCameraSN'
|
6
|
+
self.primary_key = 'id_local'
|
7
|
+
|
8
|
+
has_many :exif_metadatas, foreign_key: 'cameraSNRef'
|
9
|
+
has_many :images, through: :exif_metadatas
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Lrcat
|
2
|
+
module Catalog
|
3
|
+
|
4
|
+
class ExifMetadata < ActiveRecord::Base
|
5
|
+
self.table_name = 'AgHarvestedExifMetadata'
|
6
|
+
self.primary_key = 'id_local'
|
7
|
+
|
8
|
+
belongs_to :image, foreign_key: 'image'
|
9
|
+
belongs_to :camera_model, foreign_key: 'cameraModelRef'
|
10
|
+
belongs_to :camera_serial, foreign_key: 'cameraSNRef'
|
11
|
+
belongs_to :lens, foreign_key: 'lensRef'
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Lrcat
|
2
|
+
module Catalog
|
3
|
+
|
4
|
+
class Image < ActiveRecord::Base
|
5
|
+
self.table_name = 'Adobe_images'
|
6
|
+
self.primary_key = 'id_local'
|
7
|
+
|
8
|
+
belongs_to :library_file, foreign_key: 'rootFile'
|
9
|
+
|
10
|
+
has_one :develop_settings, foreign_key: 'image'
|
11
|
+
has_one :exif_metadata, foreign_key: 'image'
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module Lrcat
|
2
|
+
module Catalog
|
3
|
+
|
4
|
+
class Lens < ActiveRecord::Base
|
5
|
+
self.table_name = 'AgInternedExifLens'
|
6
|
+
self.primary_key = 'id_local'
|
7
|
+
|
8
|
+
has_many :exif_metadatas, foreign_key: 'lensRef'
|
9
|
+
has_many :images, through: :exif_metadatas
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module Lrcat
|
2
|
+
module Catalog
|
3
|
+
|
4
|
+
class LibraryFile < ActiveRecord::Base
|
5
|
+
self.table_name = 'AgLibraryFile'
|
6
|
+
self.primary_key = 'id_local'
|
7
|
+
|
8
|
+
belongs_to :library_folder, foreign_key: 'folder'
|
9
|
+
|
10
|
+
has_one :image, foreign_key: 'rootFile'
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module Lrcat
|
2
|
+
module Catalog
|
3
|
+
|
4
|
+
class LibraryFolder < ActiveRecord::Base
|
5
|
+
self.table_name = 'AgLibraryFolder'
|
6
|
+
self.primary_key = 'id_local'
|
7
|
+
|
8
|
+
belongs_to :library_root_folder, foreign_key: 'rootFolder'
|
9
|
+
|
10
|
+
has_many :library_files, foreign_key: 'folder'
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
14
|
+
end
|
data/lrcat.gemspec
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'lrcat/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'lrcat'
|
8
|
+
spec.version = Lrcat::VERSION
|
9
|
+
spec.authors = ['Maxime Mouchet']
|
10
|
+
spec.email = ['mouchet.max@gmail.com']
|
11
|
+
spec.description = %q{ActiveRecord mappings for the Lightroom Catalog.}
|
12
|
+
spec.summary = %q{ActiveRecord mappings for the Lightroom Catalog.}
|
13
|
+
spec.homepage = 'https://github.com/maxmouchet/lrcat.rb'
|
14
|
+
spec.license = 'MIT'
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ['lib']
|
20
|
+
|
21
|
+
spec.add_development_dependency 'bundler', '~> 1.3'
|
22
|
+
spec.add_development_dependency 'rake'
|
23
|
+
|
24
|
+
spec.add_runtime_dependency 'sqlite3', '~> 1.3'
|
25
|
+
spec.add_runtime_dependency 'activerecord', '~> 4.0'
|
26
|
+
end
|
metadata
ADDED
@@ -0,0 +1,119 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: lrcat
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Maxime Mouchet
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-12-10 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.3'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: sqlite3
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ~>
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.3'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.3'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: activerecord
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '4.0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ~>
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '4.0'
|
69
|
+
description: ActiveRecord mappings for the Lightroom Catalog.
|
70
|
+
email:
|
71
|
+
- mouchet.max@gmail.com
|
72
|
+
executables: []
|
73
|
+
extensions: []
|
74
|
+
extra_rdoc_files: []
|
75
|
+
files:
|
76
|
+
- .gitignore
|
77
|
+
- Gemfile
|
78
|
+
- LICENSE.txt
|
79
|
+
- README.md
|
80
|
+
- Rakefile
|
81
|
+
- lib/lrcat.rb
|
82
|
+
- lib/lrcat/catalog.rb
|
83
|
+
- lib/lrcat/catalog/camera_model.rb
|
84
|
+
- lib/lrcat/catalog/camera_serial.rb
|
85
|
+
- lib/lrcat/catalog/develop_settings.rb
|
86
|
+
- lib/lrcat/catalog/exif_metadata.rb
|
87
|
+
- lib/lrcat/catalog/image.rb
|
88
|
+
- lib/lrcat/catalog/lens.rb
|
89
|
+
- lib/lrcat/catalog/library_file.rb
|
90
|
+
- lib/lrcat/catalog/library_folder.rb
|
91
|
+
- lib/lrcat/catalog/library_root_folder.rb
|
92
|
+
- lib/lrcat/version.rb
|
93
|
+
- lrcat.gemspec
|
94
|
+
homepage: https://github.com/maxmouchet/lrcat.rb
|
95
|
+
licenses:
|
96
|
+
- MIT
|
97
|
+
metadata: {}
|
98
|
+
post_install_message:
|
99
|
+
rdoc_options: []
|
100
|
+
require_paths:
|
101
|
+
- lib
|
102
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
103
|
+
requirements:
|
104
|
+
- - '>='
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
version: '0'
|
107
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - '>='
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '0'
|
112
|
+
requirements: []
|
113
|
+
rubyforge_project:
|
114
|
+
rubygems_version: 2.0.3
|
115
|
+
signing_key:
|
116
|
+
specification_version: 4
|
117
|
+
summary: ActiveRecord mappings for the Lightroom Catalog.
|
118
|
+
test_files: []
|
119
|
+
has_rdoc:
|