Skip to content

Commit

Permalink
removed gbs.fm specific content
Browse files Browse the repository at this point in the history
  • Loading branch information
brownan committed Oct 18, 2010
1 parent de6f5ca commit bafa678
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 161 deletions.
5 changes: 2 additions & 3 deletions playlist/context.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-

from playlist.utils import gbsfmListenerCount, ghettoListenerCount
from playlist.utils import ListenerCount
from playlist.cue import CueFile
from playlist.models import PlaylistEntry, Rating, SongReport, SongEdit

Expand All @@ -10,8 +10,7 @@
def listenersContextProcessor(request):
if not request.user.is_authenticated(): return {}
return {
'gbsfm_listeners': gbsfmListenerCount(),
'ghetto_listeners': ghettoListenerCount()
'listeners': ListenerCount(),
}

def newReportsContextProcessor(request):
Expand Down
4 changes: 2 additions & 2 deletions playlist/images/g2.xml
Expand Up @@ -4,10 +4,10 @@
<track> <!-- Shoutcast Stream -->
<title>G2</title>
<creator>G2</creator>
<location>http://gbsfm.ath.cx:8080</location>
<location>http://192.168.1.110:8000</location>
<identifier/>
<meta rel="type">mp3</meta>
<info>http://gbsfm.ath.cx/</info>
<info>http://192.168.1.110:8080</info>
</track>
</trackList>
</playlist>
14 changes: 0 additions & 14 deletions playlist/models.py
Expand Up @@ -857,17 +857,3 @@ def randomdongid():
row = cursor.fetchone()

return row

def plinfoq(self):
from django.db import connection, transaction
cursor = connection.cursor()

# Data retrieval operation - no commit required
cursor.execute("select song.id, song.title, artist.name, album.name from playlist_song song, playlist_artist artist, playlist_album album where song.artist_id = artist.id and song.album_id = album.id and song.id = (SELECT song_id FROM `gbsfm`.`playlist_playlistentry` order by id limit %s,1)", [int(self)])
row = cursor.fetchone()
return row





2 changes: 1 addition & 1 deletion playlist/templates/500.html
Expand Up @@ -7,7 +7,7 @@
</head>
<body>
<h1>500 - Internal Server Error</h1>
<p>An error has occurred. If this happens a lot, please report it on #gbs-fm at irc.buttes.org or <a href="http://forums.somethingawful.com/showthread.php?noseen=0&threadid=3337579">here</a></p>
<p>An error has occurred. If this happens a lot, please report it</p>
</body>

</html>
88 changes: 0 additions & 88 deletions playlist/templates/base.html

This file was deleted.

8 changes: 3 additions & 5 deletions playlist/templates/master.html
Expand Up @@ -351,9 +351,7 @@
<li><a href="{% url playlist.views.user user.id %}" class="boxed">&nbsp;user page</a></li>
<li><a href="{% url user_settings %}" class="boxed">&nbsp;settings</a></li>
<li><a href="{% url forum_index %}" class="boxed">&nbsp;forums</a></li>
<li><a href="http://gbs.fm:8080/listen.pls" class="boxed">&nbsp;listen!</a></li>
<li><a href="http://mibbit.com/?channel=%23gbs-fm&server=irc.buttes.org" class="boxed">&nbsp;live irc chat!</a></li>
<!--<li><a href="#" class="boxed" onclick="flashplaypop();">&nbsp;flash player</a></li> -->
<li><a href="http://192.168.1.110:8000/ices.m3u" class="boxed">&nbsp;listen!</a></li>
<li><a href="{% url django.contrib.auth.views.logout_then_login %}" class="boxed">&nbsp;logout</a></li>
{% if perms.playlist.view_edits %}
<li><a href="{% url edit_queue %}" class="boxed {% if new_edits %}new{% endif %}">&nbsp;edit queue</a></li>
Expand All @@ -368,7 +366,7 @@
{% endif %}
</ul>
<p class="listenersthing">icons from <a href="http://www.famfamfam.com/lab/icons/silk/">famfamfam</a></p>
<p class="listenersthing" title="g2:{{gbsfm_listeners}} ghetto:{{ghetto_listeners}}">listeners: {{gbsfm_listeners}}</p>
<p class="listenersthing">listeners: {{listeners}}</p>

</div>

Expand Down Expand Up @@ -441,4 +439,4 @@

</div>
</body>
</html>
</html>
30 changes: 0 additions & 30 deletions playlist/templates/register.html

This file was deleted.

2 changes: 1 addition & 1 deletion playlist/templates/upload.html
Expand Up @@ -15,7 +15,7 @@
{{ form.as_p }}
<input type="submit" value="Submit" />
</table>
<p>(<em style="font-style: normal; font-weight: bold">FTP upload</em> now available at gbs.fm on port 2100)</p>
<p>(<em style="font-style: normal; font-weight: bold">FTP uploads</em> not available yet</p>
{% if uploads %}
<p>Last ten uploads:</p>
<ul>
Expand Down
8 changes: 2 additions & 6 deletions playlist/utils.py
Expand Up @@ -7,8 +7,6 @@
import re

from django.conf import settings
GHETTO_URL = "http://ghettoradio.us:8209/"
listeners = re.compile(r'(\d+) of \d+ listeners \(\d+ unique\)')

def hashSong(file):
"""Returns sha5 hash of uploaded file. Assumes file is safely closed outside"""
Expand Down Expand Up @@ -49,6 +47,7 @@ def getObj(table, name, oldid=None):
return t


listeners = re.compile(r'(\d+) of \d+ listeners \(\d+ unique\)')
def listenerCount(url):
try:
opener = urllib2.build_opener()
Expand All @@ -61,10 +60,7 @@ def listenerCount(url):
except (IndexError, AttributeError):
return "?"

def ghettoListenerCount():
return listenerCount(GHETTO_URL)

def gbsfmListenerCount():
def ListenerCount():
return listenerCount(settings.STREAMINFO_URL)


Expand Down
14 changes: 3 additions & 11 deletions playlist/views.py
Expand Up @@ -51,12 +51,12 @@

from playlist.forms import *
from playlist.models import *
from playlist.utils import getSong, getObj, gbsfmListenerCount, ghettoListenerCount
from playlist.utils import getSong, getObj, ListenerCount
from playlist.upload import UploadedFile
from playlist.search import Search
from playlist.cue import CueFile
from playlist.pllib import Playlist
from sa import SAProfile, IDNotFoundError
#from sa import SAProfile, IDNotFoundError



Expand Down Expand Up @@ -106,8 +106,6 @@ def splaylist(request):
@permission_required('playlist.view_playlist')
def playlist(request, lastid=None):
#normal entry route
if "gbsfm.ath.cx" in request.get_host():
return HttpResponseRedirect("/images/moved.html")
return jsplaylist(request, lastid)


Expand Down Expand Up @@ -494,14 +492,8 @@ def getSong(request):
randomid = randomdongid()
return HttpResponse(int(randomid[0]))

if resource == "plinfo":
pldongid = request.GET.get('plid', 0)
playlistinfo = plinfoq(pldongid)
return HttpResponse(str(playlistinfo[0]) + "\n" + playlistinfo[2] + "\n" + playlistinfo[3] + "\n" + playlistinfo[1])
#return HttpResponse(playlistinfo)

if resource == "listeners":
return HttpResponse(gbsfmListenerCount() + " " + ghettoListenerCount())
return HttpResponse(ListenerCount())

if resource == "users":
return HttpResponse(Users.objects.all().count())
Expand Down

0 comments on commit bafa678

Please sign in to comment.