Skip to content

Commit

Permalink
Removed colored font
Browse files Browse the repository at this point in the history
  • Loading branch information
quarckster committed Nov 21, 2018
1 parent 322b56a commit 5892c11
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 38 deletions.
23 changes: 11 additions & 12 deletions resources/lib/addonworker.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,27 +97,27 @@ def add_default_headings(type=None, fmt="slp"):
# h - show hot

if "s" in fmt:
li = ExtendedListItem("[COLOR FFFFF000]Поиск[/COLOR]")
li = ExtendedListItem("Поиск")
link = get_internal_link("search", type=type)
xbmcplugin.addDirectoryItem(request.handle, link, li, False)
if "l" in fmt:
li = ExtendedListItem("[COLOR FFFFF000]Последние[/COLOR]")
li = ExtendedListItem("Последние")
link = get_internal_link("items", type=type)
xbmcplugin.addDirectoryItem(request.handle, link, li, True)
if "p" in fmt:
li = ExtendedListItem("[COLOR FFFFF000]Популярные[/COLOR]")
li = ExtendedListItem("Популярные")
link = get_internal_link("items", type=type, shortcut="/popular")
xbmcplugin.addDirectoryItem(request.handle, link, li, True)
if "a" in fmt:
li = ExtendedListItem("[COLOR FFFFF000]По алфавиту[/COLOR]")
li = ExtendedListItem("По алфавиту")
link = get_internal_link("alphabet", type=type)
xbmcplugin.addDirectoryItem(request.handle, link, li, True)
if "g" in fmt:
li = ExtendedListItem("[COLOR FFFFF000]Жанры[/COLOR]")
li = ExtendedListItem("Жанры")
link = get_internal_link("genres", type=type)
xbmcplugin.addDirectoryItem(request.handle, link, li, True)
if "h" in fmt:
li = ExtendedListItem("[COLOR FFFFF000]Горячие[/COLOR]")
li = ExtendedListItem("Горячие")
link = get_internal_link("items", type=type, shortcut="/hot")
xbmcplugin.addDirectoryItem(request.handle, link, li, True)

Expand All @@ -135,7 +135,7 @@ def index():
xbmcplugin.addDirectoryItem(request.handle, get_internal_link("login"), li, False)
else:
response = KinoPubClient("types").get()
li = ExtendedListItem("[COLOR FFFFF000]Профиль[/COLOR]")
li = ExtendedListItem("Профиль")
xbmcplugin.addDirectoryItem(request.handle, get_internal_link("profile"), li, False)
for menu_item in main_menu_items:
if menu_item.is_displayed:
Expand Down Expand Up @@ -182,7 +182,6 @@ def items(type, **kwargs):
shortcut = kwargs.pop("shortcut", "")
response = KinoPubClient("items{}".format(shortcut)).get(data=kwargs)
pagination = response["pagination"]
add_default_headings(type, fmt="s")
xbmcplugin.setContent(request.handle, "{}s".format(mediatype_map.get(type, "video")))
show_items(response["items"])
show_pagination(pagination, "items", type=type)
Expand Down Expand Up @@ -373,7 +372,7 @@ def search(type=None):
@route("/bookmarks")
def bookmarks(folder_id=None, page=None):
if folder_id is None:
li = ExtendedListItem("[COLOR FFFFF000]Создать папку[/COLOR]")
li = ExtendedListItem("Создать папку")
link = get_internal_link("create_bookmarks_folder")
xbmcplugin.addDirectoryItem(request.handle, link, li, False)
response = KinoPubClient("bookmarks").get()
Expand Down Expand Up @@ -460,13 +459,13 @@ def watching_movies():
def collections(sort=None, page=None):
response = KinoPubClient("collections/index").get(data={"sort": sort, "page": page})
xbmcplugin.setContent(request.handle, "movies")
li = ExtendedListItem("[COLOR FFFFF000]Последние[/COLOR]")
li = ExtendedListItem("Последние")
link = get_internal_link("collections", sort="-created")
xbmcplugin.addDirectoryItem(request.handle, link, li, True)
li = ExtendedListItem("[COLOR FFFFF000]Просматриваемые[/COLOR]")
li = ExtendedListItem("Просматриваемые")
link = get_internal_link("collections", sort="-watchers")
xbmcplugin.addDirectoryItem(request.handle, link, li, True)
li = ExtendedListItem("[COLOR FFFFF000]Популярные[/COLOR]")
li = ExtendedListItem("Популярные")
link = get_internal_link("collections", sort="-views")
xbmcplugin.addDirectoryItem(request.handle, link, li, True)
for item in response["items"]:
Expand Down
28 changes: 14 additions & 14 deletions resources/lib/main_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,55 +9,55 @@

main_menu_items = [
MainMenuItem(
"[COLOR FFFFF000]Закладки[/COLOR]",
"Поиск",
get_internal_link("search", type=None),
False,
eval(__settings__.getSetting("show_search").title())
),
MainMenuItem(
"Закладки",
get_internal_link("bookmarks"),
True,
True
),
MainMenuItem(
"[COLOR FFFFF000]Я смотрю[/COLOR]",
"Я смотрю",
get_internal_link("watching"),
True,
True
),
MainMenuItem(
"[COLOR FFFFF000]Недосмотренные[/COLOR]",
"Недосмотренные",
get_internal_link("watching_movies"),
True,
True
),
MainMenuItem(
"[COLOR FFFFF000]Поиск[/COLOR]",
get_internal_link("search", type=None),
False,
eval(__settings__.getSetting("show_search").title())
),
MainMenuItem(
"[COLOR FFFFF000]Последние[/COLOR]",
"Последние",
get_internal_link("items", type=None),
True,
eval(__settings__.getSetting("show_last").title())
),
MainMenuItem(
"[COLOR FFFFF000]Популярные[/COLOR]",
"Популярные",
get_internal_link("items", type=None, shortcut="/popular"),
True,
eval(__settings__.getSetting("show_popular").title())
),
MainMenuItem(
"[COLOR FFFFF000]Горячие[/COLOR]",
"Горячие",
get_internal_link("items", type=None, shortcut="/hot"),
True,
eval(__settings__.getSetting("show_hot").title())
),
MainMenuItem(
"[COLOR FFFFF000]ТВ[/COLOR]",
"ТВ",
get_internal_link("tv"),
True,
eval(__settings__.getSetting("show_tv").title())
),
MainMenuItem(
"[COLOR FFFFF000]Подборки[/COLOR]",
"Подборки",
get_internal_link("collections"),
True,
eval(__settings__.getSetting("show_collections").title())
Expand Down
22 changes: 10 additions & 12 deletions tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,19 +112,17 @@ def side_effect(value):

def test_index(mocker, index, main, xbmcplugin, ExtendedListItem):
main()
c = u"[COLOR FFFFF000]{}[/COLOR]"
expected_results = [
(handle, plugin.format("profile"), c.format(u"Профиль"), False),
(handle, plugin.format("search?type=None"), c.format(u"Поиск"), False),
(handle, plugin.format("items?type=None"), c.format(u"Последние"), True),
(handle, plugin.format("items?type=None&shortcut=%2Fpopular"), c.format(u"Популярные"),
True),
(handle, plugin.format("items?type=None&shortcut=%2Fhot"), c.format(u"Популярные"), True),
(handle, plugin.format("tv"), c.format(u"ТВ"), True),
(handle, plugin.format("bookmarks"), c.format(u"Закладки"), True),
(handle, plugin.format("watching"), c.format(u"Я смотрю"), True),
(handle, plugin.format("watching_movies"), c.format(u"Недосмотренные"), True),
(handle, plugin.format("collections"), c.format(u"Подборки"), True),
(handle, plugin.format("profile"), u"Профиль", False),
(handle, plugin.format("search?type=None"), u"Поиск", False),
(handle, plugin.format("items?type=None"), u"Последние", True),
(handle, plugin.format("items?type=None&shortcut=%2Fpopular"), u"Популярные", True),
(handle, plugin.format("items?type=None&shortcut=%2Fhot"), u"Популярные", True),
(handle, plugin.format("tv"), u"ТВ", True),
(handle, plugin.format("bookmarks"), u"Закладки", True),
(handle, plugin.format("watching"), u"Я смотрю", True),
(handle, plugin.format("watching_movies"), u"Недосмотренные", True),
(handle, plugin.format("collections"), u"Подборки", True),
(handle, plugin.format("item_index?type=movie"), u"Фильмы", True),
(handle, plugin.format("item_index?type=serial"), u"Сериалы", True),
(handle, plugin.format("item_index?type=tvshow"), u"ТВ шоу", True),
Expand Down

0 comments on commit 5892c11

Please sign in to comment.