update pandora.local

This commit is contained in:
j 2010-09-14 16:10:37 +02:00
parent 293f6117ca
commit b56811350b
5 changed files with 20 additions and 9 deletions

View file

@ -13,7 +13,7 @@ from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.db.models import Q, Avg, Count, Sum
from django.http import HttpResponse, Http404
from django.shortcuts import render_to_response, get_object_or_404, get_list_or_404
from django.shortcuts import render_to_response, get_object_or_404, get_list_or_404, redirect
from django.template import RequestContext
from django.conf import settings
@ -250,6 +250,12 @@ def api_editFile(request): #FIXME: should this be file.files. or part of update
response = json_response(status=501, text='not implemented')
return render_to_json_response(response)
def lookup_file(request, oshash):
f = get_object_or_404(models.File, oshash=oshash)
return redirect(f.movie.get_absolute_url())
"""
def api_fileInfo(request):
'''

View file

@ -144,6 +144,9 @@ class Movie(models.Model):
return u'%s (%s)' % (self.get('title'), self.get('year'))
return self.get('title')
def get_absolute_url(self):
return '/timeline#%s' % self.movieId
def save(self, *args, **kwargs):
self.json = self.get_json()
if not self.oxdbId:

View file

@ -19,12 +19,12 @@ XSENDFILE = False
XACCELREDIRECT = False
# with nginx:
#XACCELREDIRECT=[/some/path/, /protected/]
#XACCELREDIRECT=['/srv/pandora/pandora/media/', '/media/']
'''
this assumes the following configuration:
location /protected/ {
location /media/ {
internal;
root /some/path/;
root /srv/pandora/pandora/media/;
}
'''

View file

@ -235,10 +235,10 @@ app.afterLaunch.push(function() {
},
],
id: "volume",
request: function(options) {
request: function(options, callback) {
Ox.print("options, volumes", options)
if(!options.range) {
options.callback({
callback({
data: {
items: 58
}
@ -246,7 +246,7 @@ app.afterLaunch.push(function() {
} else {
app.local.files(name, function(result) {
var fileInfo = result.info;
app.request('update', {
app.api.update({
'volume': name, 'files': result.files
}, function(result) {
var videos = {};
@ -301,7 +301,7 @@ app.afterLaunch.push(function() {
post.info[oshash] = fileInfo[oshash];
}
});
app.request('update', post, function(result) {
app.api.update(post, function(result) {
parseResult(result);
});
} else {
@ -337,7 +337,7 @@ app.afterLaunch.push(function() {
data: data,
}
Ox.print(r);
options.callback(r);
callback(r);
});
}

View file

@ -16,6 +16,8 @@ urlpatterns = patterns('',
(r'^$', 'app.views.intro'),
(r'^ra$', 'app.views.index'),
(r'^timeline$', 'app.views.timeline'),
(r'^file/(?P<oshash>.*)$', 'archive.views.lookup_file'),
(r'^r/(?P<key>.*)$', 'oxuser.views.recover'),
(r'', include('backend.urls')),