Exemple #1
0
def update_memcache(sid):
	_update_schedule_memcache(sid)
	update_live_voting(sid)
	cache.prime_rating_cache_for_events(sid, [ current[sid] ] + upnext[sid] + history[sid])
	cache.set_station(sid, "current_listeners", listeners.get_listeners_dict(sid), True)
	cache.set_station(sid, "album_diff", playlist.get_updated_albums_dict(sid), True)
	rainwave.playlist_objects.album.clear_updated_albums(sid)
	cache.set_station(sid, "all_albums", playlist.get_all_albums_list(sid), True)
	cache.set_station(sid, "all_albums_no_searchable", playlist.get_all_albums_list(sid, with_searchable=False), True)
	cache.set_station(sid, "all_artists", playlist.get_all_artists_list(sid), True)
	cache.set_station(sid, "all_artists_no_searchable", playlist.get_all_artists_list(sid, with_searchable=False), True)
	cache.set_station(sid, "all_groups", playlist.get_all_groups_list(sid), True)
	cache.set_station(sid, "all_groups_no_searchable", playlist.get_all_groups_list(sid, with_searchable=False), True)
	cache.set_station(sid, "all_groups_power", playlist.get_all_groups_for_power(sid), True)
	cache.set_station(sid, "all_groups_power_no_searchable", playlist.get_all_groups_for_power(sid, with_searchable=False), True)

	potential_dj_ids = []
	if getattr(current[sid], 'dj_user_id', None):
		potential_dj_ids.append(current[sid].dj_user_id)
	for evt in upnext[sid]:
		if getattr(evt, 'dj_user_id', None):
			potential_dj_ids.append(evt.dj_user_id)
	if len(history[sid]) and history[sid][-1] and getattr(history[sid][-1], 'dj_user_id', None):
		potential_dj_ids.append(history[sid][-1].dj_user_id)
	cache.set_station(sid, "dj_user_ids", potential_dj_ids)
Exemple #2
0
def update_memcache(sid):
    _update_schedule_memcache(sid)
    update_live_voting(sid)
    cache.prime_rating_cache_for_events(sid, [current[sid]] + upnext[sid] +
                                        history[sid])
    cache.set_station(sid, "current_listeners",
                      listeners.get_listeners_dict(sid), True)
    cache.set_station(sid, "album_diff", playlist.get_updated_albums_dict(sid),
                      True)
    rainwave.playlist_objects.album.clear_updated_albums(sid)
    cache.set_station(sid, "all_albums", playlist.get_all_albums_list(sid),
                      True)
    cache.set_station(
        sid,
        "all_albums_no_searchable",
        playlist.get_all_albums_list(sid, with_searchable=False),
        True,
    )
    cache.set_station(sid, "all_artists", playlist.get_all_artists_list(sid),
                      True)
    cache.set_station(
        sid,
        "all_artists_no_searchable",
        playlist.get_all_artists_list(sid, with_searchable=False),
        True,
    )
    cache.set_station(sid, "all_groups", playlist.get_all_groups_list(sid),
                      True)
    cache.set_station(
        sid,
        "all_groups_no_searchable",
        playlist.get_all_groups_list(sid, with_searchable=False),
        True,
    )
    cache.set_station(sid, "all_groups_power",
                      playlist.get_all_groups_for_power(sid), True)
    cache.set_station(
        sid,
        "all_groups_power_no_searchable",
        playlist.get_all_groups_for_power(sid, with_searchable=False),
        True,
    )

    potential_dj_ids = []
    if getattr(current[sid], "dj_user_id", None):
        potential_dj_ids.append(current[sid].dj_user_id)
    for evt in upnext[sid]:
        if getattr(evt, "dj_user_id", None):
            potential_dj_ids.append(evt.dj_user_id)
    if (history[sid] and history[sid][-1]
            and getattr(history[sid][-1], "dj_user_id", None)):
        potential_dj_ids.append(history[sid][-1].dj_user_id)
    cache.set_station(sid, "dj_user_ids", potential_dj_ids)
Exemple #3
0
def update_memcache(sid):
	_update_schedule_memcache(sid)
	cache.prime_rating_cache_for_events(sid, [ current[sid] ] + upnext[sid] + history[sid])
	cache.set_station(sid, "current_listeners", listeners.get_listeners_dict(sid), True)
	cache.set_station(sid, "album_diff", playlist.get_updated_albums_dict(sid), True)
	rainwave.playlist_objects.album.clear_updated_albums(sid)
	cache.set_station(sid, "all_albums", playlist.get_all_albums_list(sid), True)
	cache.set_station(sid, "all_artists", playlist.get_all_artists_list(sid), True)
	cache.set_station(sid, "all_groups", playlist.get_all_groups_list(sid), True)