Last active
February 7, 2025 18:29
-
-
Save Kamikadze22rus/87342dc5f2498807c3463fcf1e8bcd08 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
'use strict'; | |
console.log('[RusMovies] Плагин загружен'); | |
// Ждем, пока Lampa полностью загрузится | |
Lampa.Listener.follow('app', function(e) { | |
if (e.type === 'ready') { | |
console.log('[RusMovies] Lampa готова, добавляем раздел'); | |
try { | |
// Создаем иконку для меню | |
const iconSvg = ` | |
<svg xmlns="http://www.w3.org/2000/svg" | |
width="24" | |
height="24" | |
viewBox="0 0 24 24" | |
style="fill: currentColor;"> | |
<path d="M18 11h-6V7h6m0 10h-6v-4h6m-8-2H4V7h6m0 10H4v-4h6m-8 8h20V5H2v14Z"/> | |
</svg> | |
`; | |
// Добавляем раздел в главное меню | |
Lampa.Menu.add({ | |
name: 'rus_movies', | |
group: 'main', | |
title: 'Русские фильмы', | |
icon: iconSvg, | |
action: function() { | |
console.log('[RusMovies] Переход в раздел "Русские фильмы"'); | |
// Открываем раздел с русскими фильмами | |
Lampa.Activity.push({ | |
url: 'discover/movie?with_original_language=ru&sort_by=popularity.desc', | |
title: 'Русские фильмы', | |
component: 'category_full', | |
source: 'tmdb', | |
card_type: 'poster', | |
page: 1 | |
}); | |
} | |
}); | |
console.log('[RusMovies] Раздел успешно добавлен'); | |
} catch (e) { | |
console.error('[RusMovies] Ошибка при добавлении раздела:', e); | |
} | |
} | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment