Skip to content

Commit

Permalink
make the restoration of audio lang the patch, rather than optional
Browse files Browse the repository at this point in the history
  • Loading branch information
pellcorp committed Oct 10, 2015
1 parent b9a4cef commit 973cd4d
Show file tree
Hide file tree
Showing 12 changed files with 60 additions and 59 deletions.
1 change: 0 additions & 1 deletion admin/s_site_plugin/sql/amazon.sql
Expand Up @@ -45,7 +45,6 @@ INSERT INTO s_site_plugin_s_attribute_type_map ( site_type, s_item_type_group, s
INSERT INTO s_site_plugin_s_attribute_type_map ( site_type, s_item_type_group, s_item_type, variable, s_attribute_type, lookup_attribute_val_restrict_ind ) VALUES ( 'amazon', 'VIDEO', '*', 'blurb', 'MOVIE_PLOT', 'N' );
INSERT INTO s_site_plugin_s_attribute_type_map ( site_type, s_item_type_group, s_item_type, variable, s_attribute_type, lookup_attribute_val_restrict_ind ) VALUES ( 'amazon', '*', '*', 'audio_lang', 'AUDIO_LANG', 'Y' );
INSERT INTO s_site_plugin_s_attribute_type_map ( site_type, s_item_type_group, s_item_type, variable, s_attribute_type, lookup_attribute_val_restrict_ind ) VALUES ( 'amazon', '*', '*', 'audio_xtra', 'AUDIO_XTRA', 'Y' );
INSERT INTO s_site_plugin_s_attribute_type_map ( site_type, s_item_type_group, s_item_type, variable, s_attribute_type, lookup_attribute_val_restrict_ind ) VALUES ( 'amazon', '*', 'DVD', 'dvd_audio', 'AUDIO_LANG', 'Y' );
INSERT INTO s_site_plugin_s_attribute_type_map ( site_type, s_item_type_group, s_item_type, variable, s_attribute_type, lookup_attribute_val_restrict_ind ) VALUES ( 'amazon', '*', 'BOOK', 'genre', 'BOOKGENRE', 'Y' );
INSERT INTO s_site_plugin_s_attribute_type_map ( site_type, s_item_type_group, s_item_type, variable, s_attribute_type, lookup_attribute_val_restrict_ind ) VALUES ( 'amazon', '*', 'GAME', 'genre', 'GAMEGENRE', 'Y' );
INSERT INTO s_site_plugin_s_attribute_type_map ( site_type, s_item_type_group, s_item_type, variable, s_attribute_type, lookup_attribute_val_restrict_ind ) VALUES ( 'amazon', 'VIDEO', '*', 'genre', 'MOVIEGENRE', 'Y' );
Expand Down
1 change: 0 additions & 1 deletion admin/s_site_plugin/sql/amazonde.sql
Expand Up @@ -58,7 +58,6 @@ INSERT INTO s_site_plugin_s_attribute_type_map ( site_type, s_item_type_group, s
INSERT INTO s_site_plugin_s_attribute_type_map ( site_type, s_item_type_group, s_item_type, variable, s_attribute_type, lookup_attribute_val_restrict_ind ) VALUES ( 'amazonde', 'VIDEO', '*', 'blurb', 'MOVIE_PLOT', 'N' );
INSERT INTO s_site_plugin_s_attribute_type_map ( site_type, s_item_type_group, s_item_type, variable, s_attribute_type, lookup_attribute_val_restrict_ind ) VALUES ( 'amazonde', '*', '*', 'audio_lang', 'AUDIO_LANG', 'Y' );
INSERT INTO s_site_plugin_s_attribute_type_map ( site_type, s_item_type_group, s_item_type, variable, s_attribute_type, lookup_attribute_val_restrict_ind ) VALUES ( 'amazonde', '*', '*', 'audio_xtra', 'AUDIO_XTRA', 'Y' );
INSERT INTO s_site_plugin_s_attribute_type_map ( site_type, s_item_type_group, s_item_type, variable, s_attribute_type, lookup_attribute_val_restrict_ind ) VALUES ( 'amazonde', '*', 'DVD', 'dvd_audio', 'AUDIO_LANG', 'Y' );
INSERT INTO s_site_plugin_s_attribute_type_map ( site_type, s_item_type_group, s_item_type, variable, s_attribute_type, lookup_attribute_val_restrict_ind ) VALUES ( 'amazonde', '*', 'BOOK', 'genre', 'BOOKGENRE', 'Y' );
INSERT INTO s_site_plugin_s_attribute_type_map ( site_type, s_item_type_group, s_item_type, variable, s_attribute_type, lookup_attribute_val_restrict_ind ) VALUES ( 'amazonde', '*', 'BOOK', 'language', 'TEXT_LANG', 'Y' );
INSERT INTO s_site_plugin_s_attribute_type_map ( site_type, s_item_type_group, s_item_type, variable, s_attribute_type, lookup_attribute_val_restrict_ind ) VALUES ( 'amazonde', '*', 'GAME', 'genre', 'GAMEGENRE', 'Y' );
Expand Down
1 change: 0 additions & 1 deletion admin/s_site_plugin/sql/amazonecs.sql
Expand Up @@ -45,7 +45,6 @@ INSERT INTO s_site_plugin_s_attribute_type_map ( site_type, s_item_type_group, s
INSERT INTO s_site_plugin_s_attribute_type_map ( site_type, s_item_type_group, s_item_type, variable, s_attribute_type, lookup_attribute_val_restrict_ind ) VALUES ( 'amazonecs', 'VIDEO', '*', 'blurb', 'MOVIE_PLOT', 'N' );
INSERT INTO s_site_plugin_s_attribute_type_map ( site_type, s_item_type_group, s_item_type, variable, s_attribute_type, lookup_attribute_val_restrict_ind ) VALUES ( 'amazonecs', '*', '*', 'audio_lang', 'AUDIO_LANG', 'Y' );
INSERT INTO s_site_plugin_s_attribute_type_map ( site_type, s_item_type_group, s_item_type, variable, s_attribute_type, lookup_attribute_val_restrict_ind ) VALUES ( 'amazonecs', '*', '*', 'audio_xtra', 'AUDIO_XTRA', 'Y' );
INSERT INTO s_site_plugin_s_attribute_type_map ( site_type, s_item_type_group, s_item_type, variable, s_attribute_type, lookup_attribute_val_restrict_ind ) VALUES ( 'amazonecs', '*', 'DVD', 'dvd_audio', 'AUDIO_LANG', 'Y' );
INSERT INTO s_site_plugin_s_attribute_type_map ( site_type, s_item_type_group, s_item_type, variable, s_attribute_type, lookup_attribute_val_restrict_ind ) VALUES ( 'amazonecs', '*', 'BOOK', 'genre', 'BOOKGENRE', 'Y' );
INSERT INTO s_site_plugin_s_attribute_type_map ( site_type, s_item_type_group, s_item_type, variable, s_attribute_type, lookup_attribute_val_restrict_ind ) VALUES ( 'amazonecs', 'VIDEO', '*', 'genre', 'MOVIEGENRE', 'Y' );
INSERT INTO s_site_plugin_s_attribute_type_map ( site_type, s_item_type_group, s_item_type, variable, s_attribute_type, lookup_attribute_val_restrict_ind ) VALUES ( 'amazonecs', 'AUDIO', '*', 'genre', 'MUSICGENRE', 'Y' );
Expand Down
1 change: 0 additions & 1 deletion admin/s_site_plugin/sql/amazonfr.sql
Expand Up @@ -51,7 +51,6 @@ INSERT INTO s_site_plugin_s_attribute_type_map ( site_type, s_item_type_group, s
INSERT INTO s_site_plugin_s_attribute_type_map ( site_type, s_item_type_group, s_item_type, variable, s_attribute_type, lookup_attribute_val_restrict_ind ) VALUES ( 'amazonfr', '*', 'BOOK', 'blurb', 'SYNOPSIS', 'N' );
INSERT INTO s_site_plugin_s_attribute_type_map ( site_type, s_item_type_group, s_item_type, variable, s_attribute_type, lookup_attribute_val_restrict_ind ) VALUES ( 'amazonfr', '*', '*', 'audio_lang', 'AUDIO_LANG', 'Y' );
INSERT INTO s_site_plugin_s_attribute_type_map ( site_type, s_item_type_group, s_item_type, variable, s_attribute_type, lookup_attribute_val_restrict_ind ) VALUES ( 'amazonfr', '*', '*', 'audio_xtra', 'AUDIO_XTRA', 'Y' );
INSERT INTO s_site_plugin_s_attribute_type_map ( site_type, s_item_type_group, s_item_type, variable, s_attribute_type, lookup_attribute_val_restrict_ind ) VALUES ( 'amazonfr', '*', 'DVD', 'dvd_audio', 'AUDIO_LANG', 'Y' );
INSERT INTO s_site_plugin_s_attribute_type_map ( site_type, s_item_type_group, s_item_type, variable, s_attribute_type, lookup_attribute_val_restrict_ind ) VALUES ( 'amazonfr', 'VIDEO', '*', 'genre', 'MOVIEGENRE', 'Y' );
INSERT INTO s_site_plugin_s_attribute_type_map ( site_type, s_item_type_group, s_item_type, variable, s_attribute_type, lookup_attribute_val_restrict_ind ) VALUES ( 'amazonfr', '*', '*', 'subtitles', 'SUBTITLES', 'Y' );
INSERT INTO s_site_plugin_s_attribute_type_map ( site_type, s_item_type_group, s_item_type, variable, s_attribute_type, lookup_attribute_val_restrict_ind ) VALUES ( 'amazonfr', '*', '*', 'title', 'S_TITLE', 'N' );
Expand Down
1 change: 0 additions & 1 deletion admin/s_site_plugin/sql/amazonuk.sql
Expand Up @@ -45,7 +45,6 @@ INSERT INTO s_site_plugin_s_attribute_type_map ( site_type, s_item_type_group, s
INSERT INTO s_site_plugin_s_attribute_type_map ( site_type, s_item_type_group, s_item_type, variable, s_attribute_type, lookup_attribute_val_restrict_ind ) VALUES ( 'amazonuk', 'VIDEO', '*', 'blurb', 'MOVIE_PLOT', 'N' );
INSERT INTO s_site_plugin_s_attribute_type_map ( site_type, s_item_type_group, s_item_type, variable, s_attribute_type, lookup_attribute_val_restrict_ind ) VALUES ( 'amazonuk', '*', '*', 'audio_lang', 'AUDIO_LANG', 'Y' );
INSERT INTO s_site_plugin_s_attribute_type_map ( site_type, s_item_type_group, s_item_type, variable, s_attribute_type, lookup_attribute_val_restrict_ind ) VALUES ( 'amazonuk', '*', '*', 'audio_xtra', 'AUDIO_XTRA', 'Y' );
INSERT INTO s_site_plugin_s_attribute_type_map ( site_type, s_item_type_group, s_item_type, variable, s_attribute_type, lookup_attribute_val_restrict_ind ) VALUES ( 'amazonuk', '*', 'DVD', 'dvd_audio', 'AUDIO_LANG', 'Y' );
INSERT INTO s_site_plugin_s_attribute_type_map ( site_type, s_item_type_group, s_item_type, variable, s_attribute_type, lookup_attribute_val_restrict_ind ) VALUES ( 'amazonuk', '*', 'BOOK', 'genre', 'BOOKGENRE', 'Y' );
INSERT INTO s_site_plugin_s_attribute_type_map ( site_type, s_item_type_group, s_item_type, variable, s_attribute_type, lookup_attribute_val_restrict_ind ) VALUES ( 'amazonuk', '*', 'GAME', 'genre', 'GAMEGENRE', 'Y' );
INSERT INTO s_site_plugin_s_attribute_type_map ( site_type, s_item_type_group, s_item_type, variable, s_attribute_type, lookup_attribute_val_restrict_ind ) VALUES ( 'amazonuk', 'VIDEO', '*', 'genre', 'MOVIEGENRE', 'Y' );
Expand Down
1 change: 0 additions & 1 deletion admin/s_site_plugin/sql/michaeld.sql
Expand Up @@ -28,7 +28,6 @@ INSERT INTO s_site_plugin_link ( site_type, s_item_type_group, s_item_type, orde
INSERT INTO s_site_plugin_s_attribute_type_map ( site_type, s_item_type_group, s_item_type, variable, s_attribute_type, lookup_attribute_val_restrict_ind ) VALUES ( 'michaeld', 'VIDEO', '*', 'blurb', 'MOVIE_PLOT', 'N' );
INSERT INTO s_site_plugin_s_attribute_type_map ( site_type, s_item_type_group, s_item_type, variable, s_attribute_type, lookup_attribute_val_restrict_ind ) VALUES ( 'michaeld', '*', '*', 'audio_lang', 'AUDIO_LANG', 'Y' );
INSERT INTO s_site_plugin_s_attribute_type_map ( site_type, s_item_type_group, s_item_type, variable, s_attribute_type, lookup_attribute_val_restrict_ind ) VALUES ( 'michaeld', '*', '*', 'audio_xtra', 'AUDIO_XTRA', 'Y' );
INSERT INTO s_site_plugin_s_attribute_type_map ( site_type, s_item_type_group, s_item_type, variable, s_attribute_type, lookup_attribute_val_restrict_ind ) VALUES ( 'michaeld', '*', 'DVD', 'dvd_audio', 'AUDIO_LANG', 'Y' );
INSERT INTO s_site_plugin_s_attribute_type_map ( site_type, s_item_type_group, s_item_type, variable, s_attribute_type, lookup_attribute_val_restrict_ind ) VALUES ( 'michaeld', 'VIDEO', '*', 'genre', 'MOVIEGENRE', 'Y' );
INSERT INTO s_site_plugin_s_attribute_type_map ( site_type, s_item_type_group, s_item_type, variable, s_attribute_type, lookup_attribute_val_restrict_ind ) VALUES ( 'michaeld', '*', '*', 'subtitles', 'SUBTITLES', 'Y' );
INSERT INTO s_site_plugin_s_attribute_type_map ( site_type, s_item_type_group, s_item_type, variable, s_attribute_type, lookup_attribute_val_restrict_ind ) VALUES ( 'michaeld', '*', '*', 'title', 'ALT_TITLE', 'N' );
Expand Down
42 changes: 41 additions & 1 deletion install/upgrade/1.6.0/step1.sql
@@ -1,6 +1,7 @@
#
# Add AUDIO_LANG back but don't remove DVD_AUDIO
# Restore AUDIO_LANG
#

INSERT INTO s_attribute_type_lookup ( s_attribute_type, order_no, value, display, img, checked_ind ) VALUES ( 'AUDIO_LANG', NULL, 'ENGLISH', 'English', 'english.gif', 'N' );
INSERT INTO s_attribute_type_lookup ( s_attribute_type, order_no, value, display, img, checked_ind ) VALUES ( 'AUDIO_LANG', NULL, 'ENGLISH_2.0', 'English(2.0)', 'english.gif', 'N' );
INSERT INTO s_attribute_type_lookup ( s_attribute_type, order_no, value, display, img, checked_ind ) VALUES ( 'AUDIO_LANG', NULL, 'ENGLISH_5.0', 'English(5.0)', 'dolby.gif', 'N' );
Expand All @@ -11,3 +12,42 @@ INSERT INTO s_attribute_type_lookup ( s_attribute_type, order_no, value, display
INSERT INTO s_attribute_type_lookup ( s_attribute_type, order_no, value, display, img, checked_ind ) VALUES ( 'AUDIO_LANG', NULL, 'ENGLISH_DTS', 'English(DTS)', 'dts.gif', 'N' );
INSERT INTO s_attribute_type_lookup ( s_attribute_type, order_no, value, display, img, checked_ind ) VALUES ( 'AUDIO_LANG', NULL, 'ENGLISH_SR', 'English(Surround)', 'english.gif', 'N' );
INSERT INTO s_attribute_type_lookup ( s_attribute_type, order_no, value, display, img, checked_ind ) VALUES ( 'AUDIO_LANG', NULL, 'ENGLISH_THX', 'English(THX)', 'thx.gif', 'N' );

UPDATE item_attribute SET s_attribute_type = 'AUDIO_LANG', lookup_attribute_val = 'ENGLISH_2.0', order_no = 70
WHERE s_attribute_type = 'DVD_AUDIO' AND lookup_attribute_val = 'DOLBY2.0';

UPDATE item_attribute SET s_attribute_type = 'AUDIO_LANG', lookup_attribute_val = 'ENGLISH_5.0', order_no = 70
WHERE s_attribute_type = 'DVD_AUDIO' AND lookup_attribute_val = 'DOLBY';

UPDATE item_attribute SET s_attribute_type = 'AUDIO_LANG', lookup_attribute_val = 'ENGLISH_5.1', order_no = 70
WHERE s_attribute_type = 'DVD_AUDIO' AND lookup_attribute_val = 'DOLBY5.1';

UPDATE item_attribute SET s_attribute_type = 'AUDIO_LANG', lookup_attribute_val = 'ENGLISH_6.1', order_no = 70
WHERE s_attribute_type = 'DVD_AUDIO' AND lookup_attribute_val = 'DOLBY6.1';

UPDATE item_attribute SET s_attribute_type = 'AUDIO_LANG', lookup_attribute_val = 'ENGLISH_6.1_DTS_ES', order_no = 70
WHERE s_attribute_type = 'DVD_AUDIO' AND lookup_attribute_val = 'DTS6.1';

UPDATE item_attribute SET s_attribute_type = 'AUDIO_LANG', lookup_attribute_val = 'ENGLISH_6.1_EX', order_no = 70
WHERE s_attribute_type = 'DVD_AUDIO' AND lookup_attribute_val = 'DOLBY6.1';

UPDATE item_attribute SET s_attribute_type = 'AUDIO_LANG', lookup_attribute_val = 'ENGLISH_DTS', order_no = 70
WHERE s_attribute_type = 'DVD_AUDIO' AND lookup_attribute_val = 'DTS';

UPDATE item_attribute SET s_attribute_type = 'AUDIO_LANG', lookup_attribute_val = 'ENGLISH_SR', order_no = 70
WHERE s_attribute_type = 'DVD_AUDIO' AND lookup_attribute_val = 'SURROUND';

UPDATE item_attribute SET s_attribute_type = 'AUDIO_LANG', lookup_attribute_val = 'ENGLISH_THX', order_no = 70
WHERE s_attribute_type = 'DVD_AUDIO' AND lookup_attribute_val = 'THX';

# replace any remaining with just the existing value
UPDATE item_attribute SET s_attribute_type = 'AUDIO_LANG', order_no = 70
WHERE s_attribute_type = 'DVD_AUDIO';

DELETE FROM s_item_attribute_type WHERE s_attribute_type = 'DVD_AUDIO';

DELETE FROM s_site_plugin_s_attribute_type_map WHERE s_attribute_type = 'DVD_AUDIO';
DELETE FROM s_site_plugin_s_attribute_type_lookup_map WHERE s_attribute_type = 'DVD_AUDIO';

DELETE FROM s_attribute_type_lookup WHERE s_attribute_type = 'DVD_AUDIO';
DELETE FROM s_attribute_type WHERE s_attribute_type = 'DVD_AUDIO';
42 changes: 0 additions & 42 deletions install/upgrade/1.6.0/update.sql

This file was deleted.

2 changes: 1 addition & 1 deletion install/upgrade/Upgrader_160_161.class.php
Expand Up @@ -28,7 +28,7 @@ function Upgrader_160_161()
'1.6.0',
'1.6.1',
array(
array('description'=>'Revert DVD_AUDIO refactoring'),
array('description'=>'Restore AUDIO_LANG options and delete DVD_AUDIO'),
)
);
}
Expand Down
20 changes: 14 additions & 6 deletions lib/site/amazon.class.php
Expand Up @@ -655,22 +655,30 @@ function parse_amazon_video_data($search_attributes_r, $s_item_type, $pageBuffer
}

if (preg_match("/THX Certified/i", $pageBuffer)) {
$this->addItemAttribute('dvd_audio', 'THX');
$this->addItemAttribute('audio_lang', 'ENGLISH_THX');
}

if (preg_match("!<li><b>Language:</b>[\s]*(.*?)</li>!i", $pageBuffer, $regs)) {
$audio_lang_r = explode(',', $regs[1]);

$amazon_dvd_audio_map = array(array("English", "2.0"), array("English", "5.0"), array("English", "5.1"), array("English", "6.1", "EX"), // Dolby Digital 6.1 EX
array("English", "6.1", "DTS", "ES"), // English (6.1 DTS ES)
array("English", "6.1"), array("English", "DTS"));
$amazon_dvd_audio_map = array(
array("English", "2.0"),
array("English", "5.0"),
array("English", "5.1"),
array("English", "6.1", "EX"), // Dolby Digital 6.1 EX
array("English", "6.1", "DTS", "ES"), // English (6.1 DTS ES)
array("English", "6.1"),
array("English", "DTS"));

$amazon_audio_lang_map = array(array("English"), array("French"), array("Spanish"), array("German"));
$amazon_audio_lang_map = array(
array("French"),
array("Spanish"),
array("German"));

while (list(, $audio_lang) = @each($audio_lang_r)) {
$key = parse_language_info($audio_lang, $amazon_dvd_audio_map);
if ($key !== NULL) {
$this->addItemAttribute('dvd_audio', $key);
$this->addItemAttribute('audio_lang', $key);
}

$key = parse_language_info($audio_lang, $amazon_audio_lang_map);
Expand Down
3 changes: 2 additions & 1 deletion lib/site/imdbphp.class.php
Expand Up @@ -147,7 +147,8 @@ function queryItem($search_attributes_r, $s_item_type) {
$this->addItemAttribute('imdbrating', $imdb->rating());
$this->addItemAttribute('run_time', $imdb->runtime());
$this->addItemAttribute('audio_lang', $imdb->languages());
$this->addItemAttribute('dvd_audio', $imdb->sound());
$this->addItemAttribute('audio_lang', $imdb->sound());

foreach ($imdb->mpaa() as $country => $rating) {
$country = strtolower($country);
$this->addItemAttribute($country . '_age_rating', $rating);
Expand Down
4 changes: 2 additions & 2 deletions lib/site/michaeld.class.php
Expand Up @@ -202,9 +202,9 @@ function queryItem($search_attributes_r, $s_item_type) {
}

if (preg_match('#english[^,]dolby digital 5\.1#i', $matches[1]))
$this->addItemAttribute('dvd_audio', 'ENGLISH5.1');
$this->addItemAttribute('audio_lang', 'ENGLISH_5.1');
if (preg_match('#english dts#i', $matches[1]))
$this->addItemAttribute('dvd_audio', 'ENGLISH_DTS');
$this->addItemAttribute('audio_lang', 'ENGLISH_DTS');
if (preg_match('#commentary#i', $matches[1]))
$this->addItemAttribute('audio_xtra', 'DIR_COMMENT');
}
Expand Down

0 comments on commit 973cd4d

Please sign in to comment.