Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions code/datums/components/jukebox.dm
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@
return load_songs_from_config()

/// Loads the config sounds once, and returns a copy of them.
/datum/jukebox/proc/load_songs_from_config()
/datum/jukebox/proc/load_songs_from_config(force = FALSE)
var/static/list/config_songs
if(isnull(config_songs))
if(isnull(config_songs) || force)
config_songs = list()
var/list/tracks = flist(CONFIG_JUKEBOX_SOUNDS)
for(var/track_file in tracks)
Expand Down
12 changes: 12 additions & 0 deletions code/modules/admin/verbs/jukebox_moderation.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ ADMIN_VERB(upload_jukebox_music, R_SERVER, "Jukebox Upload Music", "Upload a val

message_admins("[key_name_admin(user)] uploaded [clean_name] to the jukebox!")
to_chat(user, span_notice("Successfully uploaded [clean_name]!"))
refresh_jukebox_songs()

ADMIN_VERB(browse_jukebox_music, R_SERVER, "Jukebox Browse Music", "Browse music files for moderation.", ADMIN_CATEGORY_SERVER)
var/list/files = flist(CONFIG_JUKEBOX_SOUNDS)
Expand All @@ -51,7 +52,18 @@ ADMIN_VERB(browse_jukebox_music, R_SERVER, "Jukebox Browse Music", "Browse music
message_admins(msg)
log_admin(msg)
SSblackbox.record_feedback("associative", "jukebox_deletion", 1, list("round_id" = "[GLOB.round_id]", "deletor" = "[key_name_admin(user)]", "deleted" = "[choice]"))
refresh_jukebox_songs()
if ("Download")
user << ftp(file(path))
else
return

/// Recache the songs from config then force replace all the songs.
/proc/refresh_jukebox_songs()
var/refreshed = FALSE
for(var/obj/machinery/jukebox/jukebox in SSmachines.get_machines_by_type_and_subtypes(/obj/machinery/jukebox))
if(!refreshed)
jukebox.music_player.load_songs_from_config(TRUE)
refreshed = TRUE

jukebox.music_player.songs = jukebox.music_player.init_songs()
Loading