core/playlist: Rename PL_BANNED -> PL_HIDDEN
"Banning" a track is a bit harsh. Let's talking about hiding tracks instead, so that it sounds friendlier. Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
parent
7cdc5678c6
commit
b3592e40c0
|
@ -108,7 +108,7 @@ void collection_init(struct queue_ops *ops)
|
|||
|
||||
db_for_each(track, next, track_db_get()) {
|
||||
if (TRACK(track)->tr_library->li_enabled &&
|
||||
!playlist_has(PL_BANNED, TRACK(track)))
|
||||
!playlist_has(PL_HIDDEN, TRACK(track)))
|
||||
queue_add(&c_queue, TRACK(track));
|
||||
}
|
||||
queue_unset_flag(&c_queue, Q_ADD_FRONT);
|
||||
|
@ -202,7 +202,7 @@ void collection_update_all()
|
|||
|
||||
bool collection_ban(struct track *track)
|
||||
{
|
||||
bool ret = playlist_add(PL_BANNED, track);
|
||||
bool ret = playlist_add(PL_HIDDEN, track);
|
||||
if (ret)
|
||||
queue_remove_all(&c_queue, track);
|
||||
return ret;
|
||||
|
@ -210,7 +210,7 @@ bool collection_ban(struct track *track)
|
|||
|
||||
bool collection_unban(struct track *track)
|
||||
{
|
||||
bool ret = playlist_remove(PL_BANNED, track);
|
||||
bool ret = playlist_remove(PL_HIDDEN, track);
|
||||
if (ret)
|
||||
queue_add(&c_queue, track);
|
||||
return ret;
|
||||
|
@ -231,7 +231,7 @@ void collection_set_enabled(struct library *library, bool enabled)
|
|||
track = TRACK(dbe);
|
||||
if (track->tr_library == library) {
|
||||
if (enabled) {
|
||||
if (!playlist_has(PL_BANNED, track))
|
||||
if (!playlist_has(PL_HIDDEN, track))
|
||||
queue_add(&c_queue, track);
|
||||
} else
|
||||
queue_remove_all(&c_queue, track);
|
||||
|
|
|
@ -18,7 +18,7 @@ static inline struct index_entry *__playlist_lookup(enum playlist_t plist)
|
|||
|
||||
static inline bool __playlist_is_static(enum playlist_t plist)
|
||||
{
|
||||
return (plist == PL_FAVORITED) || (plist == PL_BANNED);
|
||||
return (plist == PL_FAVORITED) || (plist == PL_HIDDEN);
|
||||
}
|
||||
|
||||
static inline bool __playlist_is_dynamic(enum playlist_t plist)
|
||||
|
|
|
@ -58,7 +58,7 @@ public:
|
|||
if (row[p_cols.p_name] == "Favorites")
|
||||
return PL_FAVORITED;
|
||||
else if (row[p_cols.p_name] == "Banned")
|
||||
return PL_BANNED;
|
||||
return PL_HIDDEN;
|
||||
else if (row[p_cols.p_name] == "Most Played")
|
||||
return PL_MOST_PLAYED;
|
||||
else if (row[p_cols.p_name] == "Least Played")
|
||||
|
@ -125,7 +125,7 @@ public:
|
|||
|
||||
tab_selected_ids(ids);
|
||||
for (unsigned int i = 0; i < ids.size(); i++)
|
||||
if (cur == PL_BANNED)
|
||||
if (cur == PL_HIDDEN)
|
||||
collection_unban(track_get(ids[i]));
|
||||
else
|
||||
playlist_remove(cur, track_get(ids[i]));
|
||||
|
@ -186,7 +186,7 @@ struct queue_ops playlist_ops = {
|
|||
void plist :: track_loaded(struct track *track)
|
||||
{
|
||||
if (p_tab) {
|
||||
o_ban->set_active(playlist_has(PL_BANNED, track));
|
||||
o_ban->set_active(playlist_has(PL_HIDDEN, track));
|
||||
o_fav->set_active(playlist_has(PL_FAVORITED, track));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -227,7 +227,7 @@ bool Tab :: tab_add_to_playlist(enum playlist_t plist)
|
|||
|
||||
tab_selected_ids(ids);
|
||||
for (unsigned int i = 0; i < ids.size(); i++) {
|
||||
if (plist == PL_BANNED)
|
||||
if (plist == PL_HIDDEN)
|
||||
collection_ban(track_get(ids[i]));
|
||||
else
|
||||
playlist_add(plist, track_get(ids[i]));
|
||||
|
@ -243,7 +243,7 @@ bool Tab :: tab_favorite_selected()
|
|||
|
||||
void Tab :: tab_ban_selected()
|
||||
{
|
||||
tab_add_to_playlist(PL_BANNED);
|
||||
tab_add_to_playlist(PL_HIDDEN);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
enum playlist_t {
|
||||
PL_FAVORITED, /* Songs that the user likes. */
|
||||
PL_BANNED, /* Songs that the user doesn't like. */
|
||||
PL_HIDDEN, /* Songs that the user has hidden. */
|
||||
PL_UNPLAYED, /* Songs that have not been played yet. */
|
||||
PL_MOST_PLAYED, /* Songs with an above average play count. */
|
||||
PL_LEAST_PLAYED, /* Songs with a below average play count. */
|
||||
|
|
|
@ -128,10 +128,10 @@ static void test_ban()
|
|||
|
||||
db_for_each(dbe, next, track_db) {
|
||||
track = TRACK(dbe);
|
||||
test_loop_equal(playlist_has(PL_BANNED, track), (bool)false, i);
|
||||
test_loop_equal(playlist_has(PL_HIDDEN, track), (bool)false, i);
|
||||
test_loop_equal(collection_ban(track), (bool)true, i);
|
||||
test_loop_equal(collection_ban(track), (bool)false, i);
|
||||
test_loop_equal(playlist_has(PL_BANNED, track), (bool)true, i);
|
||||
test_loop_equal(playlist_has(PL_HIDDEN, track), (bool)true, i);
|
||||
test_loop_equal(queue_size(q), track_db->db_size - (i + 1), i);
|
||||
i++;
|
||||
} test_loop_passed();
|
||||
|
@ -140,10 +140,10 @@ static void test_ban()
|
|||
i = 0;
|
||||
db_for_each(dbe, next, track_db) {
|
||||
track = TRACK(dbe);
|
||||
test_loop_equal(playlist_has(PL_BANNED, track), (bool)true, i);
|
||||
test_loop_equal(playlist_has(PL_HIDDEN, track), (bool)true, i);
|
||||
test_loop_equal(collection_unban(track), (bool)true, i);
|
||||
test_loop_equal(collection_unban(track), (bool)false, i);
|
||||
test_loop_equal(playlist_has(PL_BANNED, track), (bool)false, i);
|
||||
test_loop_equal(playlist_has(PL_HIDDEN, track), (bool)false, i);
|
||||
test_loop_equal(queue_size(q), i + 1, i);
|
||||
i++;
|
||||
} test_loop_passed();
|
||||
|
|
|
@ -67,11 +67,11 @@ static void test_add()
|
|||
test_equal(queue_size(q), 2);
|
||||
|
||||
track = track_get(2);
|
||||
playlist_select(PL_BANNED);
|
||||
playlist_select(PL_HIDDEN);
|
||||
test_equal(queue_size(q), 0);
|
||||
test_equal(playlist_has(PL_BANNED, track), (bool)false);
|
||||
test_equal(playlist_add(PL_BANNED, track), (bool)true);
|
||||
test_equal(playlist_has(PL_BANNED, track), (bool)true);
|
||||
test_equal(playlist_has(PL_HIDDEN, track), (bool)false);
|
||||
test_equal(playlist_add(PL_HIDDEN, track), (bool)true);
|
||||
test_equal(playlist_has(PL_HIDDEN, track), (bool)true);
|
||||
test_equal(queue_size(q), 1);
|
||||
}
|
||||
|
||||
|
@ -95,11 +95,11 @@ static void test_remove()
|
|||
test_equal(queue_size(q), 0);
|
||||
|
||||
track = track_get(2);
|
||||
playlist_select(PL_BANNED);
|
||||
playlist_select(PL_HIDDEN);
|
||||
test_equal(queue_size(q), 1);
|
||||
test_equal(playlist_has(PL_BANNED, track), (bool)true);
|
||||
test_equal(playlist_remove(PL_BANNED, track), (bool)true);
|
||||
test_equal(playlist_has(PL_BANNED, track), (bool)false);
|
||||
test_equal(playlist_has(PL_HIDDEN, track), (bool)true);
|
||||
test_equal(playlist_remove(PL_HIDDEN, track), (bool)true);
|
||||
test_equal(playlist_has(PL_HIDDEN, track), (bool)false);
|
||||
test_equal(queue_size(q), 0);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue