mirror of
https://github.com/Yetangitu/ampache
synced 2025-10-04 10:19:25 +02:00
Revert TVShow episode tag and field names before #412 merge
This commit is contained in:
parent
64a7ea44df
commit
d672234156
3 changed files with 14 additions and 15 deletions
|
@ -68,17 +68,17 @@ class TVShow_Episode extends Video
|
|||
*/
|
||||
public static function insert(array $data, $gtypes = array(), $options = array())
|
||||
{
|
||||
if (empty($data['tv_show_name'])) {
|
||||
$data['tv_show_name'] = T_('Unknown');
|
||||
if (empty($data['tvshow'])) {
|
||||
$data['tvshow'] = T_('Unknown');
|
||||
}
|
||||
$tags = $data['genre'];
|
||||
|
||||
$tvshow = TVShow::check($data['tv_show_name'], $data['year']);
|
||||
$tvshow = TVShow::check($data['tvshow'], $data['year']);
|
||||
if ($options['gather_art'] && $tvshow && $data['tvshow_art'] && !Art::has_db($tvshow, 'tvshow')) {
|
||||
$art = new Art($tvshow, 'tvshow');
|
||||
$art->insert_url($data['tvshow_art']);
|
||||
}
|
||||
$tv_season_id = TVShow_Season::check($tvshow, $data['tv_season']);
|
||||
$tvshow_season = TVShow_Season::check($tvshow, $data['tv_season']);
|
||||
if ($options['gather_art'] && $tvshow_season && $data['tvshow_season_art'] && !Art::has_db($tvshow_season, 'tvshow_season')) {
|
||||
$art = new Art($tvshow_season, 'tvshow_season');
|
||||
$art->insert_url($data['tvshow_season_art']);
|
||||
|
@ -88,7 +88,7 @@ class TVShow_Episode extends Video
|
|||
foreach ($tags as $tag) {
|
||||
$tag = trim($tag);
|
||||
if (!empty($tag)) {
|
||||
Tag::add('tvshow_season', $tv_season_id, $tag, false);
|
||||
Tag::add('tvshow_season', $tvshow_season, $tag, false);
|
||||
Tag::add('tvshow', $tvshow, $tag, false);
|
||||
}
|
||||
}
|
||||
|
@ -97,7 +97,7 @@ class TVShow_Episode extends Video
|
|||
$sdata = $data;
|
||||
// Replace relation name with db ids
|
||||
$sdata['tvshow'] = $tvshow;
|
||||
$sdata['tv_season_id'] = $tv_season_id;
|
||||
$sdata['tvshow_season'] = $tvshow_season;
|
||||
return self::create($sdata);
|
||||
}
|
||||
|
||||
|
@ -109,7 +109,7 @@ class TVShow_Episode extends Video
|
|||
{
|
||||
$sql = "INSERT INTO `tvshow_episode` (`id`, `original_name`, `season`, `episode_number`, `summary`) " .
|
||||
"VALUES (?, ?, ?, ?, ?)";
|
||||
Dba::write($sql, array($data['id'], $data['original_name'], $data['tv_season_id'], $data['tv_episode'], $data['summary']));
|
||||
Dba::write($sql, array($data['id'], $data['original_name'], $data['tvshow_season'], $data['tvshow_episode'], $data['summary']));
|
||||
|
||||
return $data['id'];
|
||||
|
||||
|
|
|
@ -2919,7 +2919,7 @@ class Update
|
|||
|
||||
return $retval;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* update 370014
|
||||
*
|
||||
|
@ -2927,9 +2927,9 @@ class Update
|
|||
*/
|
||||
public static function update_370014()
|
||||
{
|
||||
$retval = true;
|
||||
$sql="ALTER TABLE `video` CHANGE COLUMN `release_date` `release_date` INT NULL DEFAULT NULL" ;
|
||||
$retval = Dba::write($sql) ? $retval : false;
|
||||
return $retval;
|
||||
$retval = true;
|
||||
$sql="ALTER TABLE `video` CHANGE COLUMN `release_date` `release_date` INT NULL DEFAULT NULL" ;
|
||||
$retval = Dba::write($sql) ? $retval : false;
|
||||
return $retval;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -390,10 +390,9 @@ class vainfo
|
|||
$info['description'] = $info['description'] ?: trim($tags['description']);
|
||||
|
||||
$info['tvshow'] = $info['tvshow'] ?: trim($tags['tvshow']);
|
||||
$info['tv_show_name'] = $info['tv_show_name'] ?: trim($tags['tv_show_name']);
|
||||
$info['tvshow_year'] = $info['tvshow_year'] ?: trim($tags['tvshow_year']);
|
||||
$info['tv_season'] = $info['tv_season'] ?: trim($tags['tv_season']);
|
||||
$info['tv_episode'] = $info['tv_episode'] ?: trim($tags['tv_episode']);
|
||||
$info['tvshow_season'] = $info['tvshow_season'] ?: trim($tags['tvshow_season']);
|
||||
$info['tvshow_episode'] = $info['tvshow_episode'] ?: trim($tags['tvshow_episode']);
|
||||
$info['release_date'] = $info['release_date'] ?: trim($tags['release_date']);
|
||||
|
||||
$info['tvshow_art'] = $info['tvshow_art'] ?: trim($tags['tvshow_art']);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue