Commit 3f070a6e by Phạm Văn Đoan

lưu thêm trường ca sĩ từ nguồn

parent d6aed5ad
...@@ -78,6 +78,12 @@ class KeengCrawlerTrackCommand extends Command ...@@ -78,6 +78,12 @@ class KeengCrawlerTrackCommand extends Command
if (empty($track_db[0]->composer_list)) { if (empty($track_db[0]->composer_list)) {
$track_db[0]->composer_list = isset($track->info_extra->author_name) ? $track->info_extra->author_name : null; $track_db[0]->composer_list = isset($track->info_extra->author_name) ? $track->info_extra->author_name : null;
} }
if (empty($track_db[0]->src_singer)) {
$track_db[0]->src_singer = isset($track->artists_names) ? $track->artists_names : null;
}
if (empty($track_db[0]->src_composer)) {
$track_db[0]->src_composer = isset($track->info_extra->author_name) ? $track->info_extra->author_name : null;
}
$track_db[0]->crawler_at = Carbon::now(); $track_db[0]->crawler_at = Carbon::now();
$track_db[0]->save(); $track_db[0]->save();
} }
...@@ -97,6 +103,9 @@ class KeengCrawlerTrackCommand extends Command ...@@ -97,6 +103,9 @@ class KeengCrawlerTrackCommand extends Command
$bulk_track_insert[$key_insert]['composer_list'] = isset($track->info_extra->author_name) ? $track->info_extra->author_name : null; $bulk_track_insert[$key_insert]['composer_list'] = isset($track->info_extra->author_name) ? $track->info_extra->author_name : null;
$bulk_track_insert[$key_insert]['src_thumbnail'] = isset($track->image) ? $track->image : null; $bulk_track_insert[$key_insert]['src_thumbnail'] = isset($track->image) ? $track->image : null;
$bulk_track_insert[$key_insert]['src_thumbnail_medium'] = isset($track->image310) ? $track->image310 : null; $bulk_track_insert[$key_insert]['src_thumbnail_medium'] = isset($track->image310) ? $track->image310 : null;
$bulk_track_insert[$key_insert]['src_singer'] = isset($track->singer) ? $track->singer : null;
$composer = (isset($track->info_extra) && isset($track->info_extra->author_name)) ? $track->info_extra->author_name : null;
$bulk_track_insert[$key_insert]['src_composer'] = $composer;
$bulk_track_insert[$key_insert]['crawler_at'] = Carbon::now(); $bulk_track_insert[$key_insert]['crawler_at'] = Carbon::now();
$key_insert++; $key_insert++;
......
...@@ -83,6 +83,9 @@ class NctCrawlerTrackCommand extends Command ...@@ -83,6 +83,9 @@ class NctCrawlerTrackCommand extends Command
$track_db[0]->id_nct = $track['id_nct']; $track_db[0]->id_nct = $track['id_nct'];
$track_db[0]->id_nct_str = $track['id_nct_str']; $track_db[0]->id_nct_str = $track['id_nct_str'];
$track_db[0]->link_nct = $link; $track_db[0]->link_nct = $link;
if (empty($track_db[0]->src_singer)) {
$track_db[0]->src_singer = $track['singer'];
}
$track_db[0]->crawler_at = Carbon::now(); $track_db[0]->crawler_at = Carbon::now();
$track_db[0]->save(); $track_db[0]->save();
} }
...@@ -100,6 +103,7 @@ class NctCrawlerTrackCommand extends Command ...@@ -100,6 +103,7 @@ class NctCrawlerTrackCommand extends Command
$bulk_track_insert[$key_insert]['id_nct_str'] = $track['id_nct_str']; $bulk_track_insert[$key_insert]['id_nct_str'] = $track['id_nct_str'];
$bulk_track_insert[$key_insert]['src_thumbnail_medium'] = $track['img']; $bulk_track_insert[$key_insert]['src_thumbnail_medium'] = $track['img'];
$bulk_track_insert[$key_insert]['link_nct'] = $link; $bulk_track_insert[$key_insert]['link_nct'] = $link;
$bulk_track_insert[$key_insert]['src_singer'] = $track['singer'];
$bulk_track_insert[$key_insert]['crawler_at'] = Carbon::now(); $bulk_track_insert[$key_insert]['crawler_at'] = Carbon::now();
$key_insert++; $key_insert++;
......
...@@ -99,6 +99,9 @@ class ZingCrawlerNewRealeaseCommand extends Command ...@@ -99,6 +99,9 @@ class ZingCrawlerNewRealeaseCommand extends Command
if (empty($track_db[0]->link_mv)) { if (empty($track_db[0]->link_mv)) {
$track_db[0]->link_mv = isset($track->mv_link) ? $domain . $track->mv_link : null; $track_db[0]->link_mv = isset($track->mv_link) ? $domain . $track->mv_link : null;
} }
if (empty($track_db[0]->src_singer)) {
$track_db[0]->src_singer = isset($track->artists_names) ? $track->artists_names : null;
}
$track_db[0]->crawler_at = Carbon::now(); $track_db[0]->crawler_at = Carbon::now();
$track_db[0]->save(); $track_db[0]->save();
} }
...@@ -119,6 +122,7 @@ class ZingCrawlerNewRealeaseCommand extends Command ...@@ -119,6 +122,7 @@ class ZingCrawlerNewRealeaseCommand extends Command
$bulk_track_insert[$key_insert]['src_thumbnail'] = isset($track->thumbnail) ? $track->thumbnail : null; $bulk_track_insert[$key_insert]['src_thumbnail'] = isset($track->thumbnail) ? $track->thumbnail : null;
$bulk_track_insert[$key_insert]['src_thumbnail_medium'] = isset($track->thumbnail_medium) ? $track->thumbnail_medium : null; $bulk_track_insert[$key_insert]['src_thumbnail_medium'] = isset($track->thumbnail_medium) ? $track->thumbnail_medium : null;
$bulk_track_insert[$key_insert]['link_mv'] = isset($track->mv_link) ? $domain . $track->mv_link : null; $bulk_track_insert[$key_insert]['link_mv'] = isset($track->mv_link) ? $domain . $track->mv_link : null;
$bulk_track_insert[$key_insert]['src_singer'] = isset($track->artists_names) ? $track->artists_names : null;
$bulk_track_insert[$key_insert]['crawler_at'] = Carbon::now(); $bulk_track_insert[$key_insert]['crawler_at'] = Carbon::now();
$key_insert++; $key_insert++;
......
...@@ -99,6 +99,9 @@ class ZingCrawlerTrackCommand extends Command ...@@ -99,6 +99,9 @@ class ZingCrawlerTrackCommand extends Command
if (empty($track_db[0]->link_mv)) { if (empty($track_db[0]->link_mv)) {
$track_db[0]->link_mv = isset($track->mv_link) ? $domain . $track->mv_link : null; $track_db[0]->link_mv = isset($track->mv_link) ? $domain . $track->mv_link : null;
} }
if (empty($track_db[0]->src_singer)) {
$track_db[0]->src_singer = isset($track->artists_names) ? $track->artists_names : null;
}
$track_db[0]->crawler_at = Carbon::now(); $track_db[0]->crawler_at = Carbon::now();
$track_db[0]->save(); $track_db[0]->save();
} }
...@@ -119,6 +122,7 @@ class ZingCrawlerTrackCommand extends Command ...@@ -119,6 +122,7 @@ class ZingCrawlerTrackCommand extends Command
$bulk_track_insert[$key_insert]['src_thumbnail'] = isset($track->thumbnail) ? $track->thumbnail : null; $bulk_track_insert[$key_insert]['src_thumbnail'] = isset($track->thumbnail) ? $track->thumbnail : null;
$bulk_track_insert[$key_insert]['src_thumbnail_medium'] = isset($track->thumbnail_medium) ? $track->thumbnail_medium : null; $bulk_track_insert[$key_insert]['src_thumbnail_medium'] = isset($track->thumbnail_medium) ? $track->thumbnail_medium : null;
$bulk_track_insert[$key_insert]['link_mv'] = isset($track->mv_link) ? $domain . $track->mv_link : null; $bulk_track_insert[$key_insert]['link_mv'] = isset($track->mv_link) ? $domain . $track->mv_link : null;
$bulk_track_insert[$key_insert]['src_singer'] = isset($track->artists_names) ? $track->artists_names : null;
$bulk_track_insert[$key_insert]['crawler_at'] = Carbon::now(); $bulk_track_insert[$key_insert]['crawler_at'] = Carbon::now();
$key_insert++; $key_insert++;
......
...@@ -60,7 +60,7 @@ class Kernel extends ConsoleKernel ...@@ -60,7 +60,7 @@ class Kernel extends ConsoleKernel
$schedule->command('zing:get-track')->twiceDaily(11, 20); $schedule->command('zing:get-track')->twiceDaily(11, 20);
$schedule->command('zing:get-new-release-track')->dailyAt('13:00'); $schedule->command('zing:get-new-release-track')->dailyAt('13:00');
$schedule->command('nct:get-track')->dailyAt('13:10'); //$schedule->command('nct:get-track')->dailyAt('13:10');
$schedule->command('nhacvn:get-track')->dailyAt('13:20'); $schedule->command('nhacvn:get-track')->dailyAt('13:20');
$schedule->command('keeng:get-track')->dailyAt('13:30'); $schedule->command('keeng:get-track')->dailyAt('13:30');
$schedule->command('crawler:get-track-image')->dailyAt('13:40'); $schedule->command('crawler:get-track-image')->dailyAt('13:40');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment