cinebase 5.9.3 → 5.10.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ffabe8bcfcbe9896be6fbb27f3a067729e6d3e7444bcf32452908a392cd93e6d
4
- data.tar.gz: b823bdaff6ed9cfe85e92890514c72b157af85250bfd4e704d2a4190476dc4ba
3
+ metadata.gz: 2db360e63882bc3450903c62e1eac18dcfe0e9035e95245a11c00d96039b4875
4
+ data.tar.gz: 92adad0b62500f92eab272d2c3c904d0ead4b0577227244b0624f7a326786f0c
5
5
  SHA512:
6
- metadata.gz: 4e5cb3d6be63d00e6c0f177e93f815f729b3ef046f08205600dd6db389917d75e638e50f9c9f1225674f728ecd36abf4b45a0355d9e16370d335ccc2d63228d8
7
- data.tar.gz: '0792164a88db56abcb6eef6eb4d1c3e223921ad2d47a332417c688442db6b29397d60d7e327b65f6549981c2c3e8d17eb2848ee1d0854a7cb58a936bb8d7e155'
6
+ metadata.gz: 6c164dc67593843ef61a22a31fcbaa7c9b33fe94b9840a242d261818157d3fdbc5ed94c6e03ba8ff952c866bcf7c8253b38fb290fb863de3de6b4c86a1da6632
7
+ data.tar.gz: c513227d811472f21e789a5e0d2ead0511bcceb950f9ed14498b322c2df2682c22a3edfec50820481f78a485f89c7e5f82460b08cc9b60c63dc6c10a10c225f4
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.10.1] - 2026-11-03
6
+ ### Fixed
7
+ - A1Web and Boxoffice chains name festivals with `Performance.festival_names`, as they set the festival themselves.
8
+ - A sport event drops the `arts` variant that a chain tags its events genre with.
9
+
10
+ ## [5.10.0] - 2026-11-03
11
+ ### Added
12
+ - Live sport is an `Event`: `Six Nations 2027 - England v France` gives the event Six Nations and the variant `sport`. The fixture keeps the competition in its film name. `Event#variant` is `arts` or `sport`.
13
+ - `Festival.from_title` takes `names:`, and `Performance.festival_names` lets a chain name a short form that differs by place, such as NFF.
14
+ - `+ Mulled Wine` marks the `mulled_wine` variant, and festival prefixes after `DocHouse:` are read.
15
+
5
16
  ## [5.9.3] - 2026-11-03
6
17
  ### Added
7
18
  - Festivals named in full, such as `UK Jewish Film Festival:` and `Women and the World International Film Festival:`, in brackets after the film, such as `Coward (French Film Festival)`, or with the year next to the name, such as `FFF26:`.
@@ -71,7 +71,7 @@ module Cinebase
71
71
  {
72
72
  booking_url: showing.booking_url,
73
73
  dimension: [title, *showing.tags].any? { |text| text.match?(THREE_D) } ? '3d' : '2d',
74
- festival: Festival.from_title(title, year: showing.date.year),
74
+ festival: Festival.from_title(title, year: showing.date.year, names: festival_names),
75
75
  film_name: title_sanitizer.new(title).sanitized,
76
76
  film_year: TitleSanitizer.film_year(title),
77
77
  language: title[LANGUAGE, 1],
@@ -12,6 +12,7 @@ module Cinebase
12
12
  'dog_friendly' => [/\ADog[- ]Friendly(?: Screening)?\s*[:\-–]\s*/i],
13
13
  'baby' => [/\s*\(Parent (?:&|and) Baby(?: Only Show)?\)/i],
14
14
  'members' => [/#{SEPARATOR}(?:Unlimited|MyOmnipass Member) Screening\z/i],
15
+ 'mulled_wine' => [/\s*\+\s*Mulled Wine\b.*\z/i],
15
16
  'subtitled' => [/\([^)]*\bsubtitles\)/i],
16
17
  'preview' => [
17
18
  /\s*[-–]\s*(?:Special )?Preview\z/i,
@@ -57,7 +57,7 @@ module Cinebase
57
57
  {
58
58
  booking_url: showtime.booking_url,
59
59
  dimension: showtime.dimension,
60
- festival: Festival.from_title(title, year: starting_at.year),
60
+ festival: Festival.from_title(title, year: starting_at.year, names: festival_names),
61
61
  film_name: title_sanitizer.new(title).sanitized,
62
62
  film_year: TitleSanitizer.film_year(title),
63
63
  language: showtime.language || title[/\((#{TitleSanitizer::LANGUAGES.join('|')})\)/i, 1],
@@ -17,10 +17,17 @@ module Cinebase
17
17
 
18
18
  PREFIX = Regexp.union(PREFIXES.values)
19
19
 
20
+ # Live sport, keyed by competition. The fixture keeps the competition in
21
+ # its name, as next year's "England v France" is another match.
22
+ SPORTS = {
23
+ 'Six Nations' => /\ASix Nations\b/,
24
+ 'World Rugby Nations Championship' => /\AWorld Rugby Nations Championship\b/
25
+ }.freeze
26
+
20
27
  # @param [String] film_name sanitized film name, e.g. "Met Opera: Tosca"
21
28
  # @return [Cinebase::Event, nil]
22
29
  def self.from_name(film_name)
23
- name, = PREFIXES.find { |_, prefix| film_name.match?(prefix) }
30
+ name, = PREFIXES.merge(SPORTS).find { |_, prefix| film_name.match?(prefix) }
24
31
  new(name: name) if name
25
32
  end
26
33
 
@@ -29,5 +36,14 @@ module Cinebase
29
36
  def self.strip(film_name)
30
37
  film_name.sub(PREFIX, '')
31
38
  end
39
+
40
+ # @return [String] the screening variant the event adds: arts or sport
41
+ def variant
42
+ if SPORTS.key?(name)
43
+ 'sport'
44
+ else
45
+ 'arts'
46
+ end
47
+ end
32
48
  end
33
49
  end
@@ -34,7 +34,7 @@ module Cinebase
34
34
  /\A(Cine-Excess) (20\d{2}): /,
35
35
  /\A(Cinemagic) (\d{4}) -/,
36
36
  /\A(Horror Season) (20\d{2}) /,
37
- /\A(#{NAME_PATTERN})(?: ?((?:20)?\d{2}))?(?:\s*[:–-]\s*|\s+(?=Shorts:))/
37
+ /\A(?:DocHouse:\s*)?(#{NAME_PATTERN})(?: ?((?:20)?\d{2}))?(?:\s*[:–-]\s*|\s+(?=Shorts:))/
38
38
  ].freeze
39
39
 
40
40
  # A festival named after the film, such as "Party USA - NFF UK Premier"
@@ -43,18 +43,20 @@ module Cinebase
43
43
  # A festival in brackets after the film, such as "Coward (French Film Festival)"
44
44
  BRACKETED = /\s*\((#{NAME_PATTERN})(?: ((?:20)?\d{2}))?\)/
45
45
 
46
- PATTERNS =[*PREFIXES, SUFFIX, BRACKETED].freeze
46
+ PATTERNS = [*PREFIXES, SUFFIX, BRACKETED].freeze
47
47
 
48
48
  CENTURY = 2000
49
49
 
50
50
  # @param [String] title raw film title
51
51
  # @param [Integer] year the edition when the title gives none, usually the
52
52
  # screening's year
53
+ # @param [Hash{String => String}] names full names for short forms that
54
+ # differ by chain, such as NFF
53
55
  # @return [Cinebase::Festival, nil]
54
- def self.from_title(title, year:)
56
+ def self.from_title(title, year:, names: {})
55
57
  PATTERNS.each do |pattern|
56
58
  match = title.match(pattern)
57
- return new(name: FULL_NAMES.fetch(match[1], match[1]), year: edition(match[2]) || year) if match
59
+ return new(name: FULL_NAMES.merge(names).fetch(match[1], match[1]), year: edition(match[2]) || year) if match
58
60
  end
59
61
  nil
60
62
  end
@@ -43,9 +43,14 @@ module Cinebase
43
43
  starting_at.to_date
44
44
  end
45
45
 
46
+ # Full names for festival short forms that differ by chain, such as NFF
47
+ def self.festival_names
48
+ {}
49
+ end
50
+
46
51
  # Given, or named by the raw title
47
52
  def festival
48
- @festival || (title && Festival.from_title(title, year: starting_at.year))
53
+ @festival || (title && Festival.from_title(title, year: starting_at.year, names: self.class.festival_names))
49
54
  end
50
55
 
51
56
  # The show's own name when it is an Event, e.g. "Tosca"
@@ -58,9 +63,15 @@ module Cinebase
58
63
  Event.from_name(@film_name)
59
64
  end
60
65
 
66
+ # Chains list sport under their events genre, which they tag as arts
61
67
  def variant
62
68
  @variant = @variant.split(' ') if @variant.is_a?(String)
63
- (@variant + title_variants).map(&:downcase).sort.uniq
69
+ variants = (@variant + title_variants).map(&:downcase).sort.uniq
70
+ if event&.variant == 'sport'
71
+ variants - %w(arts)
72
+ else
73
+ variants
74
+ end
64
75
  end
65
76
 
66
77
  # English subtitles or open captions
@@ -72,7 +83,7 @@ module Cinebase
72
83
 
73
84
  def title_variants
74
85
  audiences = title ? Audience.variants(title) : []
75
- event ? audiences + %w(arts) : audiences
86
+ event ? audiences + [event.variant] : audiences
76
87
  end
77
88
  end
78
89
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Cinebase version
4
4
  module Cinebase
5
- VERSION = '5.9.3'
5
+ VERSION = '5.10.1'
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cinebase
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.9.3
4
+ version: 5.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Croll