cinebase 5.2.0 → 5.3.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/README.md +14 -1
- data/lib/cinebase/festival.rb +2 -1
- data/lib/cinebase/performance.rb +2 -0
- data/lib/cinebase/title_sanitizer.rb +14 -2
- data/lib/cinebase/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b497375ced74ea56a85b85027ff086e690432d8296a2b43e4d2d59103579a593
|
|
4
|
+
data.tar.gz: 1b277120417de80d13097b49ac8d5203f9a54bb8214a3842ea25120b2eb71c6a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3b6c03efd197eba1cfc566839c09b05c7f22c64a05cdade0806417507d4a014befeef4ab0451cbdc360f0df28a810ec7a7843e08be6fcc9c3b413007ed2440c2
|
|
7
|
+
data.tar.gz: da91b411310832dc36e999024a094f87321a4597033ad97a38627e10a4d2be44a6656bda1c392bb8ec2696db22755008d05da0f18859a6fe909b5a14b1e6f6de
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
|
3
3
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
|
4
4
|
|
|
5
|
+
## [5.3.0] - 2026-10-22
|
|
6
|
+
### Added
|
|
7
|
+
- `Performance#film_year` with an optional `film_year:` option, and `TitleSanitizer.film_year` reading a trailing `(1996)` from a title
|
|
8
|
+
- `COMMON_REMOVE` strips that year, `(Re-release)` and Lithuanian versions
|
|
9
|
+
- `Horror Season` title prefixes are festivals, so `Horror Season 2026 From Dusk Till Dawn (1996)` becomes `From Dusk Till Dawn`, year 1996, in the Horror Season 2026
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
- Indentation of tests added in 5.2.0
|
|
13
|
+
|
|
5
14
|
## [5.2.0] - 2026-10-22
|
|
6
15
|
### Added
|
|
7
16
|
- `Performance#festival`, `#language` and `#subtitled?`, with optional `festival:` and `language:` options
|
data/README.md
CHANGED
|
@@ -45,7 +45,7 @@ module CinemaChainName
|
|
|
45
45
|
def self.at(cinema_id)
|
|
46
46
|
# parse webpages or apis to get performances for a cinema, built with
|
|
47
47
|
# booking_url:, cinema_id:, cinema_name:, dimension:, festival:,
|
|
48
|
-
# film_name:, language:, starting_at: and variant:
|
|
48
|
+
# film_name:, film_year:, language:, starting_at: and variant:
|
|
49
49
|
end
|
|
50
50
|
end
|
|
51
51
|
end
|
|
@@ -85,6 +85,19 @@ Cinebase::Festival.from_title('UKJFF - From Cable Street To Brick Lane', year: 2
|
|
|
85
85
|
|
|
86
86
|
`COMMON_REMOVE` strips the same prefixes from titles.
|
|
87
87
|
|
|
88
|
+
### Film years
|
|
89
|
+
|
|
90
|
+
Titles often end with the film's year. `COMMON_REMOVE` strips it, and
|
|
91
|
+
`TitleSanitizer.film_year` reads it so it can be passed as `film_year:`:
|
|
92
|
+
|
|
93
|
+
```ruby
|
|
94
|
+
Cinebase::TitleSanitizer.film_year('Street Fighter (2026)') #=> 2026
|
|
95
|
+
Cinebase::TitleSanitizer.film_year('Kung Fu Soccer (2026) (Dubbed)') #=> 2026
|
|
96
|
+
Cinebase::TitleSanitizer.film_year('Blade Runner 2049') #=> nil
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
For a re-release this is the original year, which is what IMDb lists.
|
|
100
|
+
|
|
88
101
|
### Vista OCAPI chains
|
|
89
102
|
|
|
90
103
|
Chains whose websites run on Vista share a client, guest token retrieval and
|
data/lib/cinebase/festival.rb
CHANGED
data/lib/cinebase/performance.rb
CHANGED
|
@@ -9,6 +9,7 @@ module Cinebase
|
|
|
9
9
|
attr_reader :cinema_name
|
|
10
10
|
attr_reader :festival
|
|
11
11
|
attr_reader :film_name
|
|
12
|
+
attr_reader :film_year
|
|
12
13
|
attr_reader :language
|
|
13
14
|
|
|
14
15
|
def initialize(options)
|
|
@@ -18,6 +19,7 @@ module Cinebase
|
|
|
18
19
|
@dimension = options.fetch(:dimension, '2d')
|
|
19
20
|
@festival = options.fetch(:festival, nil)
|
|
20
21
|
@film_name = options.fetch(:film_name)
|
|
22
|
+
@film_year = options.fetch(:film_year, nil)
|
|
21
23
|
@language = options.fetch(:language, nil)
|
|
22
24
|
@time = options.fetch(:starting_at)
|
|
23
25
|
@variant = options.fetch(:variant, [])
|
|
@@ -32,8 +32,12 @@ module Cinebase
|
|
|
32
32
|
# Rules every chain can share; subclasses opt in after their own patterns,
|
|
33
33
|
# e.g. `[...] + COMMON_REMOVE` in #remove
|
|
34
34
|
class TitleSanitizer
|
|
35
|
-
LANGUAGES = %w(Arabic Cantonese French Hindi Kannada Korean
|
|
36
|
-
Mandarin Marathi Polish Punjabi Tamil Telugu
|
|
35
|
+
LANGUAGES = %w(Arabic Cantonese French Hindi Kannada Korean Lithuanian
|
|
36
|
+
Malayalam Mandarin Marathi Polish Punjabi Tamil Telugu
|
|
37
|
+
Turkish).freeze
|
|
38
|
+
|
|
39
|
+
# A trailing "(1996)", allowing other bracketed markers after it
|
|
40
|
+
FILM_YEAR = /\s*\((1[89]\d{2}|20\d{2})\)(?=(?:\s*\([^)]*\))*\s*\z)/
|
|
37
41
|
|
|
38
42
|
COMMON_REMOVE = [
|
|
39
43
|
*Festival::PREFIXES, # festival prefix
|
|
@@ -41,12 +45,20 @@ module Cinebase
|
|
|
41
45
|
/\((#{LANGUAGES.join('|')})\)/i, # language version
|
|
42
46
|
/\((Dubbed|Subbed|English Dub|[^)]*subtitles)\)/i, # dub or subtitle version
|
|
43
47
|
/\(\d+(st|nd|rd|th) Anniversary\)/i, # anniversary re-release
|
|
48
|
+
/\(Re-release\)/i, # re-release
|
|
49
|
+
FILM_YEAR, # film year, see .film_year
|
|
44
50
|
/\s*\+\s*(In-Person )?Q&A\z/i, # Q&A add-on
|
|
45
51
|
/:\s*Encore\z/i, # encore
|
|
46
52
|
/\bsing-?a-?long\z/i, # singalong
|
|
47
53
|
'amp;' # html ampersands
|
|
48
54
|
].freeze
|
|
49
55
|
|
|
56
|
+
# @param [String] title raw film title
|
|
57
|
+
# @return [Integer, nil] the film's year from a trailing "(1996)"
|
|
58
|
+
def self.film_year(title)
|
|
59
|
+
title[FILM_YEAR, 1]&.to_i
|
|
60
|
+
end
|
|
61
|
+
|
|
50
62
|
COMMON_REPLACE = {
|
|
51
63
|
/Met Opera 20\d{2}-\d{2}: (.*)/ => 'Met Opera: ',
|
|
52
64
|
/RBO (?:Cinema Season )?20\d{2}-\d{2}: (.*)/ => 'Royal Ballet and Opera: ',
|
data/lib/cinebase/version.rb
CHANGED