cinebase 5.9.2 → 5.10.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b3ac8fcd0aa75c6bd83bf57573243062934e29facf62f47ef5a8e8da84cd500b
4
- data.tar.gz: 5e7989a03538de4200833f2aa3eab1ed0bebfc27f46e95b6526f5711f937f9ac
3
+ metadata.gz: 1b67130fa05f03842aea737a21037d7edcde83150a79fc1b08a1103254dce774
4
+ data.tar.gz: 28246516a82aaec038e6f8e5b04b08daec53982b14d6a247960ca0829dd76744
5
5
  SHA512:
6
- metadata.gz: 87be5f35f85ae4262cf552343e51546bf0f39bca4dbac73cf05e73bb3c7f327e740d06f3dd34749ca30f1768c51c0411e90530705a46e0f68f9d4a9fa1864911
7
- data.tar.gz: e210368f288ea23eb89e424043503818a4ee7437afee72399ad98f0b84ab1c358976b78e5ba3ada7cdf2274c4c6f1edf705d0759fdb11df235fe68dd3d7309a3
6
+ metadata.gz: 56a50db84fc430e120ae9f041b0b9ecef45c2b720a2ebcd114357645c141d703e88f36f49df3969ce1521f5ef89976a64bc1704544fde9c86bf8291ad965470a
7
+ data.tar.gz: ffecdc3674167e55deebb3d6d1befda86dd25a4ede4b2c8917f7f1c96dd3a4bacc4a2e471341120c0b5f1cca9a42344c5073dc370511b8b24967a9fadc2a7e21
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.0] - 2026-11-03
6
+ ### Added
7
+ - 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`.
8
+ - `Festival.from_title` takes `names:`, and `Performance.festival_names` lets a chain name a short form that differs by place, such as NFF.
9
+ - `+ Mulled Wine` marks the `mulled_wine` variant, and festival prefixes after `DocHouse:` are read.
10
+
11
+ ## [5.9.3] - 2026-11-03
12
+ ### Added
13
+ - 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:`.
14
+ - `Dog Friendly:` without a hyphen marks a dog-friendly screening, and `(Preview)` or `[Preview]` a preview.
15
+
5
16
  ## [5.9.2] - 2026-11-03
6
17
  ### Changed
7
18
  - Festivals take their full name, so chains agree: `CFF` is Cambridge Film Festival, `FFF` and `French Film Fest UK` are French Film Festival, `IFF` is Into Film Festival, `JFF` and `UKJFF` are UK Jewish Film Festival, `LPFF` is London Palestine Film Festival, `RFF` is Romanian Film Festival and `SLA` is Scotland Loves Anime.
@@ -9,12 +9,14 @@ module Cinebase
9
9
  LABELS = {
10
10
  'kids' => [/\A(?:Toddler (?:Club|Kino)|Kids'? Club)\s*:\s*/i],
11
11
  'relaxed' => [/\ARelaxed(?: Screening)?\s*:\s*/i, /#{SEPARATOR}(?:Sensory|Autism) Friendly Screening\z/i],
12
- 'dog_friendly' => [/\ADog-Friendly(?: Screening)?\s*[:\-–]\s*/i],
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,
19
+ /\s*[(\[]Preview[)\]]/i,
18
20
  /\s*[:\-–]\s*Preview and Q(?:&|\+)A\z/i,
19
21
  /\ASee It First\s*[-–:]\s*/i
20
22
  ]
@@ -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
@@ -6,9 +6,10 @@ module Cinebase
6
6
  # An annual festival edition a film is screened in
7
7
  class Festival
8
8
  NAMES = [
9
- 'CFF', 'Cinecity', 'FFF', 'French Film Fest UK', 'IFF', 'Into Film Festival', 'JFF', 'LDNDOCS',
10
- 'London Palestine Film Festival', 'LPFF', 'NFF', 'Queer East', 'RFF', 'SLA', 'UKJFF',
11
- 'Women and the World Festival'
9
+ 'CFF', 'Cinecity', 'FFF', 'French Film Fest UK', 'French Film Festival', 'IFF', 'Into Film Festival',
10
+ 'JFF', 'LDNDOCS', 'London Palestine Film Festival', 'LPFF', 'NFF', 'Queer East', 'RFF', 'SLA',
11
+ 'UK Jewish Film Festival', 'UKJFF', 'Women and the World', 'Women and the World Festival',
12
+ 'Women and the World International Film Festival'
12
13
  ].freeze
13
14
 
14
15
  # Full names for short forms, so every chain names a festival alike
@@ -21,34 +22,41 @@ module Cinebase
21
22
  'LPFF' => 'London Palestine Film Festival',
22
23
  'RFF' => 'Romanian Film Festival',
23
24
  'SLA' => 'Scotland Loves Anime',
24
- 'UKJFF' => 'UK Jewish Film Festival'
25
+ 'UKJFF' => 'UK Jewish Film Festival',
26
+ 'Women and the World' => 'Women and the World Festival',
27
+ 'Women and the World International Film Festival' => 'Women and the World Festival'
25
28
  }.freeze
26
29
 
27
- NAME_PATTERN = NAMES.map { |name| Regexp.escape(name) }.join('|')
30
+ NAME_PATTERN = NAMES.sort_by { |name| -name.length }.map { |name| Regexp.escape(name) }.join('|')
28
31
 
29
32
  # Title prefixes naming a festival: the name, then the year when given
30
33
  PREFIXES = [
31
34
  /\A(Cine-Excess) (20\d{2}): /,
32
35
  /\A(Cinemagic) (\d{4}) -/,
33
36
  /\A(Horror Season) (20\d{2}) /,
34
- /\A(#{NAME_PATTERN})(?: ((?:20)?\d{2}))?(?:\s*[:–-]\s*|\s+(?=Shorts:))/
37
+ /\A(?:DocHouse:\s*)?(#{NAME_PATTERN})(?: ?((?:20)?\d{2}))?(?:\s*[:–-]\s*|\s+(?=Shorts:))/
35
38
  ].freeze
36
39
 
37
40
  # A festival named after the film, such as "Party USA - NFF UK Premier"
38
41
  SUFFIX = /\s+[-–]\s+(#{NAME_PATTERN})\b(?: ((?:20)?\d{2})\b)?.*\z/
39
42
 
40
- PATTERNS = [*PREFIXES, SUFFIX].freeze
43
+ # A festival in brackets after the film, such as "Coward (French Film Festival)"
44
+ BRACKETED = /\s*\((#{NAME_PATTERN})(?: ((?:20)?\d{2}))?\)/
45
+
46
+ PATTERNS = [*PREFIXES, SUFFIX, BRACKETED].freeze
41
47
 
42
48
  CENTURY = 2000
43
49
 
44
50
  # @param [String] title raw film title
45
51
  # @param [Integer] year the edition when the title gives none, usually the
46
52
  # screening's year
53
+ # @param [Hash{String => String}] names full names for short forms that
54
+ # differ by chain, such as NFF
47
55
  # @return [Cinebase::Festival, nil]
48
- def self.from_title(title, year:)
56
+ def self.from_title(title, year:, names: {})
49
57
  PATTERNS.each do |pattern|
50
58
  match = title.match(pattern)
51
- 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
52
60
  end
53
61
  nil
54
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"
@@ -72,7 +77,7 @@ module Cinebase
72
77
 
73
78
  def title_variants
74
79
  audiences = title ? Audience.variants(title) : []
75
- event ? audiences + %w(arts) : audiences
80
+ event ? audiences + [event.variant] : audiences
76
81
  end
77
82
  end
78
83
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Cinebase version
4
4
  module Cinebase
5
- VERSION = '5.9.2'
5
+ VERSION = '5.10.0'
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.2
4
+ version: 5.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Croll