forked from 0x2620/pandora
update pandora.local
This commit is contained in:
parent
293f6117ca
commit
b56811350b
5 changed files with 20 additions and 9 deletions
|
@ -13,7 +13,7 @@ from django.contrib.auth.decorators import login_required
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
from django.db.models import Q, Avg, Count, Sum
|
from django.db.models import Q, Avg, Count, Sum
|
||||||
from django.http import HttpResponse, Http404
|
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.template import RequestContext
|
||||||
from django.conf import settings
|
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')
|
response = json_response(status=501, text='not implemented')
|
||||||
return render_to_json_response(response)
|
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):
|
def api_fileInfo(request):
|
||||||
'''
|
'''
|
||||||
|
|
|
@ -144,6 +144,9 @@ class Movie(models.Model):
|
||||||
return u'%s (%s)' % (self.get('title'), self.get('year'))
|
return u'%s (%s)' % (self.get('title'), self.get('year'))
|
||||||
return self.get('title')
|
return self.get('title')
|
||||||
|
|
||||||
|
def get_absolute_url(self):
|
||||||
|
return '/timeline#%s' % self.movieId
|
||||||
|
|
||||||
def save(self, *args, **kwargs):
|
def save(self, *args, **kwargs):
|
||||||
self.json = self.get_json()
|
self.json = self.get_json()
|
||||||
if not self.oxdbId:
|
if not self.oxdbId:
|
||||||
|
|
|
@ -19,12 +19,12 @@ XSENDFILE = False
|
||||||
|
|
||||||
XACCELREDIRECT = False
|
XACCELREDIRECT = False
|
||||||
# with nginx:
|
# with nginx:
|
||||||
#XACCELREDIRECT=[/some/path/, /protected/]
|
#XACCELREDIRECT=['/srv/pandora/pandora/media/', '/media/']
|
||||||
'''
|
'''
|
||||||
this assumes the following configuration:
|
this assumes the following configuration:
|
||||||
location /protected/ {
|
location /media/ {
|
||||||
internal;
|
internal;
|
||||||
root /some/path/;
|
root /srv/pandora/pandora/media/;
|
||||||
}
|
}
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -235,10 +235,10 @@ app.afterLaunch.push(function() {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
id: "volume",
|
id: "volume",
|
||||||
request: function(options) {
|
request: function(options, callback) {
|
||||||
Ox.print("options, volumes", options)
|
Ox.print("options, volumes", options)
|
||||||
if(!options.range) {
|
if(!options.range) {
|
||||||
options.callback({
|
callback({
|
||||||
data: {
|
data: {
|
||||||
items: 58
|
items: 58
|
||||||
}
|
}
|
||||||
|
@ -246,7 +246,7 @@ app.afterLaunch.push(function() {
|
||||||
} else {
|
} else {
|
||||||
app.local.files(name, function(result) {
|
app.local.files(name, function(result) {
|
||||||
var fileInfo = result.info;
|
var fileInfo = result.info;
|
||||||
app.request('update', {
|
app.api.update({
|
||||||
'volume': name, 'files': result.files
|
'volume': name, 'files': result.files
|
||||||
}, function(result) {
|
}, function(result) {
|
||||||
var videos = {};
|
var videos = {};
|
||||||
|
@ -301,7 +301,7 @@ app.afterLaunch.push(function() {
|
||||||
post.info[oshash] = fileInfo[oshash];
|
post.info[oshash] = fileInfo[oshash];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
app.request('update', post, function(result) {
|
app.api.update(post, function(result) {
|
||||||
parseResult(result);
|
parseResult(result);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
@ -337,7 +337,7 @@ app.afterLaunch.push(function() {
|
||||||
data: data,
|
data: data,
|
||||||
}
|
}
|
||||||
Ox.print(r);
|
Ox.print(r);
|
||||||
options.callback(r);
|
callback(r);
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,8 @@ urlpatterns = patterns('',
|
||||||
(r'^$', 'app.views.intro'),
|
(r'^$', 'app.views.intro'),
|
||||||
(r'^ra$', 'app.views.index'),
|
(r'^ra$', 'app.views.index'),
|
||||||
(r'^timeline$', 'app.views.timeline'),
|
(r'^timeline$', 'app.views.timeline'),
|
||||||
|
(r'^file/(?P<oshash>.*)$', 'archive.views.lookup_file'),
|
||||||
|
|
||||||
(r'^r/(?P<key>.*)$', 'oxuser.views.recover'),
|
(r'^r/(?P<key>.*)$', 'oxuser.views.recover'),
|
||||||
(r'', include('backend.urls')),
|
(r'', include('backend.urls')),
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue