summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorailurux <ailuruxx@gmail.com>2024-09-27 16:59:59 +1000
committerailurux <ailuruxx@gmail.com>2024-09-27 16:59:59 +1000
commit3490cceb6b94ffbc947b699c8495cf8500e65b98 (patch)
tree60cf92de52ec965e10f8d2cbc5f69ed442718bf5 /src
parentf8a6c8c85af534510dfc2840730387d67b4c82ff (diff)
downloadtangara-fw-3490cceb6b94ffbc947b699c8495cf8500e65b98.tar.gz
Added listened indicator for audiobooks and podcasts
Diffstat (limited to 'src')
-rw-r--r--src/tangara/database/index.cpp2
-rw-r--r--src/tangara/lua/lua_database.cpp18
2 files changed, 19 insertions, 1 deletions
diff --git a/src/tangara/database/index.cpp b/src/tangara/database/index.cpp
index 0ced27ed..1cdc0d07 100644
--- a/src/tangara/database/index.cpp
+++ b/src/tangara/database/index.cpp
@@ -60,7 +60,7 @@ const IndexInfo kPodcasts{
.id = 5,
.type = MediaType::kPodcast,
.name = "Podcasts",
- .components = {Tag::kTitle},
+ .components = {Tag::kAlbum, Tag::kTitle},
};
const IndexInfo kAudiobooks{
diff --git a/src/tangara/lua/lua_database.cpp b/src/tangara/lua/lua_database.cpp
index 39179bf3..2a3ab59d 100644
--- a/src/tangara/lua/lua_database.cpp
+++ b/src/tangara/lua/lua_database.cpp
@@ -388,6 +388,24 @@ static auto lua_database(lua_State* state) -> int {
luaL_setfuncs(state, kDbRecordFuncs, 0);
luaL_newlib(state, kDatabaseFuncs);
+
+ lua_pushliteral(state, "MediaTypes");
+ lua_newtable(state);
+ lua_pushliteral(state, "Unknown");
+ lua_pushinteger(state, (int)database::MediaType::kUnknown);
+ lua_rawset(state, -3);
+ lua_pushliteral(state, "Music");
+ lua_pushinteger(state, (int)database::MediaType::kMusic);
+ lua_rawset(state, -3);
+ lua_pushliteral(state, "Podcast");
+ lua_pushinteger(state, (int)database::MediaType::kPodcast);
+ lua_rawset(state, -3);
+ lua_pushliteral(state, "Audiobook");
+ lua_pushinteger(state, (int)database::MediaType::kAudiobook);
+ lua_rawset(state, -3);
+ lua_rawset(state, -3);
+
+
return 1;
}