Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
djrandom-py-deleted-112
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This project is pending deletion, and will be deleted on
2025-06-14
. Repository and other project resources are read-only.
Show more breadcrumbs
ale
djrandom-py-deleted-112
Commits
fe0a3ff7
Commit
fe0a3ff7
authored
13 years ago
by
Robert J. Newmark
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of git.autistici.org:djrandom
parents
43bff6ef
4ded54e8
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
server/djrandom/frontend/api_views.py
+1
-1
1 addition, 1 deletion
server/djrandom/frontend/api_views.py
server/djrandom/model/mp3.py
+2
-1
2 additions, 1 deletion
server/djrandom/model/mp3.py
with
3 additions
and
2 deletions
server/djrandom/frontend/api_views.py
+
1
−
1
View file @
fe0a3ff7
...
@@ -161,7 +161,7 @@ def most_played_json():
...
@@ -161,7 +161,7 @@ def most_played_json():
@require_auth
@require_auth
def
last_uploaded_json
():
def
last_uploaded_json
():
n
=
int
(
request
.
args
.
get
(
'
n
'
,
20
))
n
=
int
(
request
.
args
.
get
(
'
n
'
,
20
))
last_uploaded
=
[
x
.
to_dict
()
for
x
in
MP3
.
last_uploaded
(
n
)]
last_uploaded
=
[
x
.
sha1
for
x
in
MP3
.
last_uploaded
(
n
)]
return
jsonify
(
results
=
last_uploaded
)
return
jsonify
(
results
=
last_uploaded
)
...
...
This diff is collapsed.
Click to expand it.
server/djrandom/model/mp3.py
+
2
−
1
View file @
fe0a3ff7
...
@@ -39,7 +39,8 @@ class MP3(Base):
...
@@ -39,7 +39,8 @@ class MP3(Base):
@classmethod
@classmethod
def
last_uploaded
(
cls
,
n
=
10
):
def
last_uploaded
(
cls
,
n
=
10
):
"""
Return the N last uploaded songs.
"""
"""
Return the N last uploaded songs.
"""
return
cls
.
query
.
filter_by
(
ready
=
True
).
order_by
(
'
desc uploaded_at
'
).
limit
(
n
)
return
cls
.
query
.
filter_by
(
ready
=
True
).
order_by
(
desc
(
cls
.
uploaded_at
)).
limit
(
n
)
class
PlayLog
(
Base
):
class
PlayLog
(
Base
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment