piwigo-api 0.5.4 → 0.5.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 87356665f4013fd077e465bc8bc455d65521778ecabe929b4d51e77a4f8a48f7
4
- data.tar.gz: 2febfdf137f95ccca79bdb23565373220e1f553114376b05333c944f2d8caee1
3
+ metadata.gz: abe9efb2427bfdaeeb85fe16c6fe87061704e08ec7d8f3ebadf79920940bf68e
4
+ data.tar.gz: 755900bb8cebf9a4fd325efb92eedcb87bf4030b050d64c885d7159c4700c136
5
5
  SHA512:
6
- metadata.gz: fc6d52f44e5d80aea19d572c1bf0c20027c830be07aa6d1d91cccb163be5e65f5fa190c4c7ba4aaf05b8042405c57609f3b8dbdd343285416d9e0a08548750c0
7
- data.tar.gz: 50b9ffe518dda064dbbad1c56a43cbfc0671bcec6c2eb70c1833bb3d5bf072b22eb750b7e42f7effca9b01dcc346f07fba210d2c045eca498aa371306180912e
6
+ metadata.gz: a749c2d82a6b6d4f7646696a09cc1fe1d2fc970553a9b51ea6795032e196be3fb3c5856a8d4ae1deebc39effd651621bb3a8c5f19a9d8d56d434441ebe3cf933
7
+ data.tar.gz: 90b6e8580727156339ddc99fe1322cbec925092c2af64ddb7ffa238569b4753fe150d0c0f9993e1ac680b9f8ac9d7694921efa9bcf0454de6193a76ba9973ac1
data/CHANGELOG.md CHANGED
@@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ 0.5.5 - 2019-11-26
8
+ - Fix another encoding issue when synchronizing folder with accented characters.
9
+
7
10
  0.5.4 - 2019-11-26
8
11
  - Fix crash in sniff_attributes when the image dosn't contain a valid EXIF data
9
12
  - Fix parent albums when syncronizing a folder-tree of albums into Piwigo
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- piwigo-api (0.5.4)
4
+ piwigo-api (0.5.5)
5
5
  exifr (~> 1.3)
6
6
  http (~> 4.2)
7
7
  logger (~> 1.4)
@@ -39,7 +39,7 @@ module Piwigo
39
39
  end
40
40
 
41
41
  Dir.entries(directory).reject { |entry| entry =~ /^.{1,2}$/ }.each do |directory_entry|
42
- item_to_process = File.join directory, directory_entry
42
+ item_to_process = (File.join directory, directory_entry).encode('utf-8')
43
43
 
44
44
  if File.directory? item_to_process
45
45
  @parent_album = ensure_album(File.dirname(item_to_process), nil)
data/lib/piwigo/images.rb CHANGED
@@ -51,11 +51,15 @@ module Piwigo
51
51
  attr_accessor :categories
52
52
 
53
53
  def initialize(hash: nil)
54
- hash&.each { |key, value| send("#{key}=", value) }
54
+ hash&.each do |key, value|
55
+ # Bug: If the encoding is Windows-1252, then Piwigo will blowup when creating the album
56
+ value = value.encode('UTF-8', 'Windows-1252') if value.class == String && value.encoding.to_s == 'Windows-1252'
57
+ send("#{key}=", value)
58
+ end
55
59
  end
56
60
  end
57
61
 
58
- class Paging # rubocop:todo Style/Documentation
62
+ class Paging
59
63
  # @return [Number] Page number of the results
60
64
  attr_accessor :page
61
65
 
@@ -69,7 +73,11 @@ module Piwigo
69
73
  attr_accessor :total_count
70
74
 
71
75
  def initialize(hash: nil)
72
- hash&.each { |key, value| send("#{key}=", value) }
76
+ hash&.each do |key, value|
77
+ # Bug: If the encoding is Windows-1252, then Piwigo will blowup when creating the album
78
+ value = value.encode('UTF-8', 'Windows-1252') if value.class == String && value.encoding.to_s == 'Windows-1252'
79
+ send("#{key}=", value)
80
+ end
73
81
  end
74
82
  end
75
83
 
@@ -1,3 +1,3 @@
1
1
  module Piwigo
2
- VERSION = '0.5.4'.freeze
2
+ VERSION = '0.5.5'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: piwigo-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ version: 0.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adrian Gilbert