From d0122d7b09aece1149c49d832fb2466d7853b0a1 Mon Sep 17 00:00:00 2001 From: Kaimi Date: Thu, 5 Jul 2018 17:38:02 +0300 Subject: [PATCH] Fixes #11 --- src/ya.pl | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/ya.pl b/src/ya.pl index 6fdaefb..225952b 100755 --- a/src/ya.pl +++ b/src/ya.pl @@ -40,6 +40,11 @@ use constant RENAME_ERRORS_MAX => 5 }; use constant +{ + PLAYLIST_LIKE => 3, + PLAYLIST_LIKE_TITLE => 'Мне нравится' +}; +use constant { DEBUG => 'DEBUG', ERROR => 'ERROR', @@ -684,7 +689,12 @@ sub get_playlist_tracks_info return; } - my $title = $opt{mobile} ? $json->{result}->{title} : $json->{pageData}->{playlist}->{title}; + my $title = $opt{mobile} + ? + ( $opt{playlist} == PLAYLIST_LIKE ? PLAYLIST_LIKE_TITLE : $json->{result}->{title} ) + : + $json->{pageData}->{playlist}->{title}; + if(!$title) { info(DEBUG, 'Can\'t get playlist title');