cinebase 5.3.0 → 5.5.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 +11 -0
- data/lib/cinebase/festival.rb +1 -0
- data/lib/cinebase/title_sanitizer.rb +5 -2
- data/lib/cinebase/version.rb +1 -1
- data/lib/cinebase/vista/client.rb +13 -5
- 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: fc2298d0987c599332f671cd0532398aa84df5e623492f480ba8845814713af4
|
|
4
|
+
data.tar.gz: 4186770cf7e9a235405f9245f7281c44c62bf0fb0adc83db6ccd6b86168d833d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9a5309228e4f27451c1a00fecee37b386e8aaabb9131a5447776d1ccdb4bc009c6f4fd7cd379cd204eced5ae2dc6417d41d8bb5f13e6f0e1dddd97e0dc828bfb
|
|
7
|
+
data.tar.gz: f6f1b180642f3e65adaa143be1c3f95c25aa73e3788221aaf43f9fb55eb5da65488ca5bf615ff9d5953231c8d76d6fc88350de5a0f4ea0abbe5b575289b55289
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,17 @@
|
|
|
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.5.0] - 2026-10-22
|
|
6
|
+
### Changed
|
|
7
|
+
- `Vista::Client` keeps one connection open for all its requests instead of opening a new TLS connection each time, which cost over ten times the request itself. Requests on one client are serialised, so a client can be shared between threads.
|
|
8
|
+
|
|
9
|
+
## [5.4.0] - 2026-10-22
|
|
10
|
+
### Added
|
|
11
|
+
- `Vista::Client` accepts `region_code: nil` and then sends no `Connect-Region-Code` header, for chains such as Picturehouse whose API rejects every region code
|
|
12
|
+
- `COMMON_REMOVE` strips any `+ ... Q&A` or `+ ... Q+A` add-on, `+ Discussion`, `(35mm)`, `(70mm)` and a `4K` marker
|
|
13
|
+
- `Met Opera Encore 2026-27:` titles standardise like other Met Opera seasons
|
|
14
|
+
- `CFF:` (Cambridge Film Festival) title prefixes are festivals
|
|
15
|
+
|
|
5
16
|
## [5.3.0] - 2026-10-22
|
|
6
17
|
### Added
|
|
7
18
|
- `Performance#film_year` with an optional `film_year:` option, and `TitleSanitizer.film_year` reading a trailing `(1996)` from a title
|
data/lib/cinebase/festival.rb
CHANGED
|
@@ -47,7 +47,10 @@ module Cinebase
|
|
|
47
47
|
/\(\d+(st|nd|rd|th) Anniversary\)/i, # anniversary re-release
|
|
48
48
|
/\(Re-release\)/i, # re-release
|
|
49
49
|
FILM_YEAR, # film year, see .film_year
|
|
50
|
-
/\s*\+\s*(
|
|
50
|
+
/\s*\+\s*(?:[\w-]+\s+)*Q(?:&|\+)A\z/i, # Q&A add-on
|
|
51
|
+
/\s*\+\s*Discussion\z/i, # discussion add-on
|
|
52
|
+
/\s*\((35|70)mm\)/i, # film gauge
|
|
53
|
+
/\s+4K\b/, # 4K restoration
|
|
51
54
|
/:\s*Encore\z/i, # encore
|
|
52
55
|
/\bsing-?a-?long\z/i, # singalong
|
|
53
56
|
'amp;' # html ampersands
|
|
@@ -60,7 +63,7 @@ module Cinebase
|
|
|
60
63
|
end
|
|
61
64
|
|
|
62
65
|
COMMON_REPLACE = {
|
|
63
|
-
/Met Opera 20\d{2}-\d{2}: (.*)/
|
|
66
|
+
/Met Opera (?:Encore )?20\d{2}-\d{2}: (.*)/ => 'Met Opera: ',
|
|
64
67
|
/RBO (?:Cinema Season )?20\d{2}-\d{2}: (.*)/ => 'Royal Ballet and Opera: ',
|
|
65
68
|
/WORLD TOUR(.*)/ => 'World Tour'
|
|
66
69
|
}.freeze
|
data/lib/cinebase/version.rb
CHANGED
|
@@ -8,12 +8,14 @@ module Cinebase
|
|
|
8
8
|
# Makes guest-token GET requests to a chain's OCAPI
|
|
9
9
|
class Client
|
|
10
10
|
# @param [String] base_url e.g. 'https://vwc.odeon.co.uk/WSVistaWebClient/ocapi/v1/'
|
|
11
|
-
# @param [String] region_code Connect-Region-Code header, e.g. 'UK'
|
|
11
|
+
# @param [String, nil] region_code Connect-Region-Code header, e.g. 'UK'
|
|
12
|
+
# or 'GB'; nil for chains whose API rejects every region code
|
|
12
13
|
# @param [String, nil] token raw guest JWT, without the "Bearer " prefix
|
|
13
14
|
def initialize(base_url:, region_code:, token:)
|
|
14
15
|
@base_url = base_url
|
|
15
16
|
@region_code = region_code
|
|
16
17
|
@token = token
|
|
18
|
+
@mutex = Mutex.new
|
|
17
19
|
end
|
|
18
20
|
|
|
19
21
|
# @param [String] path relative to the base URL
|
|
@@ -44,11 +46,17 @@ module Cinebase
|
|
|
44
46
|
uri.query = URI.encode_www_form(query) unless query.empty?
|
|
45
47
|
request = Net::HTTP::Get.new(uri)
|
|
46
48
|
request['Authorization'] = "Bearer #{@token}"
|
|
47
|
-
request['Connect-Region-Code'] = @region_code
|
|
49
|
+
request['Connect-Region-Code'] = @region_code if @region_code
|
|
48
50
|
request['Accept'] = 'application/json'
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
@mutex.synchronize { connection(uri).request(request) }
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# A new TLS connection per request costs over ten times the request
|
|
55
|
+
# itself. Net::HTTP reconnects after its keep-alive timeout and retries
|
|
56
|
+
# a GET once on a dropped connection.
|
|
57
|
+
def connection(uri)
|
|
58
|
+
@connection ||= Net::HTTP.start(uri.host, uri.port, use_ssl: true,
|
|
59
|
+
open_timeout: 10, read_timeout: 30)
|
|
52
60
|
end
|
|
53
61
|
end
|
|
54
62
|
end
|