mirror of
https://github.com/Yetangitu/ampache
synced 2025-10-05 02:39:47 +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())
|
public static function insert(array $data, $gtypes = array(), $options = array())
|
||||||
{
|
{
|
||||||
if (empty($data['tv_show_name'])) {
|
if (empty($data['tvshow'])) {
|
||||||
$data['tv_show_name'] = T_('Unknown');
|
$data['tvshow'] = T_('Unknown');
|
||||||
}
|
}
|
||||||
$tags = $data['genre'];
|
$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')) {
|
if ($options['gather_art'] && $tvshow && $data['tvshow_art'] && !Art::has_db($tvshow, 'tvshow')) {
|
||||||
$art = new Art($tvshow, 'tvshow');
|
$art = new Art($tvshow, 'tvshow');
|
||||||
$art->insert_url($data['tvshow_art']);
|
$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')) {
|
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 = new Art($tvshow_season, 'tvshow_season');
|
||||||
$art->insert_url($data['tvshow_season_art']);
|
$art->insert_url($data['tvshow_season_art']);
|
||||||
|
@ -88,7 +88,7 @@ class TVShow_Episode extends Video
|
||||||
foreach ($tags as $tag) {
|
foreach ($tags as $tag) {
|
||||||
$tag = trim($tag);
|
$tag = trim($tag);
|
||||||
if (!empty($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);
|
Tag::add('tvshow', $tvshow, $tag, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -97,7 +97,7 @@ class TVShow_Episode extends Video
|
||||||
$sdata = $data;
|
$sdata = $data;
|
||||||
// Replace relation name with db ids
|
// Replace relation name with db ids
|
||||||
$sdata['tvshow'] = $tvshow;
|
$sdata['tvshow'] = $tvshow;
|
||||||
$sdata['tv_season_id'] = $tv_season_id;
|
$sdata['tvshow_season'] = $tvshow_season;
|
||||||
return self::create($sdata);
|
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`) " .
|
$sql = "INSERT INTO `tvshow_episode` (`id`, `original_name`, `season`, `episode_number`, `summary`) " .
|
||||||
"VALUES (?, ?, ?, ?, ?)";
|
"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'];
|
return $data['id'];
|
||||||
|
|
||||||
|
|
|
@ -390,10 +390,9 @@ class vainfo
|
||||||
$info['description'] = $info['description'] ?: trim($tags['description']);
|
$info['description'] = $info['description'] ?: trim($tags['description']);
|
||||||
|
|
||||||
$info['tvshow'] = $info['tvshow'] ?: trim($tags['tvshow']);
|
$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['tvshow_year'] = $info['tvshow_year'] ?: trim($tags['tvshow_year']);
|
||||||
$info['tv_season'] = $info['tv_season'] ?: trim($tags['tv_season']);
|
$info['tvshow_season'] = $info['tvshow_season'] ?: trim($tags['tvshow_season']);
|
||||||
$info['tv_episode'] = $info['tv_episode'] ?: trim($tags['tv_episode']);
|
$info['tvshow_episode'] = $info['tvshow_episode'] ?: trim($tags['tvshow_episode']);
|
||||||
$info['release_date'] = $info['release_date'] ?: trim($tags['release_date']);
|
$info['release_date'] = $info['release_date'] ?: trim($tags['release_date']);
|
||||||
|
|
||||||
$info['tvshow_art'] = $info['tvshow_art'] ?: trim($tags['tvshow_art']);
|
$info['tvshow_art'] = $info['tvshow_art'] ?: trim($tags['tvshow_art']);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue