Verified Commit 9dc69ac1 authored by Agate's avatar Agate 💬

Merge branch 'release/0.5.2'

parents 452193c6 84d6e22e
Pipeline #453 passed with stages
in 4 minutes and 7 seconds
...@@ -5,6 +5,17 @@ Changelog ...@@ -5,6 +5,17 @@ Changelog
---------------- ----------------
0.5.2 (2018-02-26)
------------------
- Fixed broken file import due to wrong url (#73)
- More accurate mimetype detection
- Fixed really small size on small screens
- Added masonry layout for artists, requests and radios (#68)
- We now have a favicon!
- Fixed truncated play icon (#65)
0.5.1 (2018-02-24) 0.5.1 (2018-02-24)
------------------ ------------------
......
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
__version__ = '0.5.1' __version__ = '0.5.2'
__version_info__ = tuple([int(num) if num.isdigit() else num for num in __version__.replace('-', '.', 1).split('.')]) __version_info__ = tuple([int(num) if num.isdigit() else num for num in __version__.replace('-', '.', 1).split('.')])
import magic import magic
import mimetypes
import re import re
from django.db.models import Q from django.db.models import Q
...@@ -42,7 +43,13 @@ def get_query(query_string, search_fields): ...@@ -42,7 +43,13 @@ def get_query(query_string, search_fields):
def guess_mimetype(f): def guess_mimetype(f):
b = min(100000, f.size) b = min(100000, f.size)
return magic.from_buffer(f.read(b), mime=True) t = magic.from_buffer(f.read(b), mime=True)
if t == 'application/octet-stream':
# failure, we try guessing by extension
mt, _ = mimetypes.guess_type(f.path)
if mt:
t = mt
return t
def compute_status(jobs): def compute_status(jobs):
......
from funkwhale_api.music import utils
def test_guess_mimetype_try_using_extension(factories, mocker):
mocker.patch(
'magic.from_buffer', return_value='audio/mpeg')
f = factories['music.TrackFile'].build(
audio_file__filename='test.ogg')
assert utils.guess_mimetype(f.audio_file) == 'audio/mpeg'
def test_guess_mimetype_try_using_extension_if_fail(factories, mocker):
mocker.patch(
'magic.from_buffer', return_value='application/octet-stream')
f = factories['music.TrackFile'].build(
audio_file__filename='test.mp3')
assert utils.guess_mimetype(f.audio_file) == 'audio/mpeg'
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>Funkwhale</title> <title>Funkwhale</title>
<link rel="shortcut icon" type="image/png" href="/static/favicon.png"/>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head> </head>
<body> <body>
<div id="app"></div> <div id="app"></div>
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
"js-logger": "^1.3.0", "js-logger": "^1.3.0",
"jwt-decode": "^2.2.0", "jwt-decode": "^2.2.0",
"lodash": "^4.17.4", "lodash": "^4.17.4",
"masonry-layout": "^4.2.1",
"moment": "^2.20.1", "moment": "^2.20.1",
"moxios": "^0.4.0", "moxios": "^0.4.0",
"raven-js": "^3.22.3", "raven-js": "^3.22.3",
...@@ -27,6 +28,7 @@ ...@@ -27,6 +28,7 @@
"showdown": "^1.8.6", "showdown": "^1.8.6",
"vue": "^2.3.3", "vue": "^2.3.3",
"vue-lazyload": "^1.1.4", "vue-lazyload": "^1.1.4",
"vue-masonry": "^0.10.16",
"vue-router": "^2.3.1", "vue-router": "^2.3.1",
"vue-upload-component": "^2.7.4", "vue-upload-component": "^2.7.4",
"vuedraggable": "^2.14.1", "vuedraggable": "^2.14.1",
......
...@@ -59,7 +59,7 @@ export default { ...@@ -59,7 +59,7 @@ export default {
html, body { html, body {
@include media("<desktop") { @include media("<desktop") {
font-size: 200%; font-size: 90%;
} }
} }
#app { #app {
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<table class="ui very basic fixed single line compact unstackable table"> <table class="ui very basic fixed single line compact unstackable table">
<tbody> <tbody>
<tr v-for="track in tracks"> <tr v-for="track in tracks">
<td> <td class="play-cell">
<play-button class="basic icon" :track="track" :discrete="true"></play-button> <play-button class="basic icon" :track="track" :discrete="true"></play-button>
</td> </td>
<td colspan="6"> <td colspan="6">
...@@ -67,7 +67,7 @@ export default { ...@@ -67,7 +67,7 @@ export default {
data () { data () {
return { return {
backend: backend, backend: backend,
initialTracks: 4, initialTracks: 5,
showAllTracks: false showAllTracks: false
} }
}, },
...@@ -85,6 +85,9 @@ export default { ...@@ -85,6 +85,9 @@ export default {
<!-- Add "scoped" attribute to limit CSS to this component only --> <!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="scss"> <style scoped lang="scss">
table.fixed td.play-cell {
overflow: auto;
}
tr { tr {
.favorite-icon:not(.favorited) { .favorite-icon:not(.favorited) {
display: none; display: none;
......
...@@ -54,8 +54,8 @@ export default { ...@@ -54,8 +54,8 @@ export default {
data () { data () {
return { return {
backend: backend, backend: backend,
initialAlbums: 3, initialAlbums: 30,
showAllAlbums: false showAllAlbums: true
} }
}, },
computed: { computed: {
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
</div> </div>
<div class="ui vertical stripe segment"> <div class="ui vertical stripe segment">
<h2>Albums by this artist</h2> <h2>Albums by this artist</h2>
<div class="ui stackable three column grid"> <div class="ui stackable doubling three column grid">
<div class="column" :key="album.id" v-for="album in albums"> <div class="column" :key="album.id" v-for="album in albums">
<album-card :mode="'rich'" class="fluid" :album="album"></album-card> <album-card :mode="'rich'" class="fluid" :album="album"></album-card>
</div> </div>
......
...@@ -34,8 +34,16 @@ ...@@ -34,8 +34,16 @@
</div> </div>
</div> </div>
<div class="ui hidden divider"></div> <div class="ui hidden divider"></div>
<div v-if="result" class="ui stackable three column grid"> <div
v-if="result"
v-masonry
transition-duration="0"
item-selector=".column"
percent-position="true"
stagger="0"
class="ui stackable three column doubling grid">
<div <div
v-masonry-tile
v-if="result.results.length > 0" v-if="result.results.length > 0"
v-for="artist in result.results" v-for="artist in result.results"
:key="artist.id" :key="artist.id"
......
...@@ -36,8 +36,16 @@ ...@@ -36,8 +36,16 @@
</div> </div>
</div> </div>
<div class="ui hidden divider"></div> <div class="ui hidden divider"></div>
<div v-if="result" class="ui stackable three column grid"> <div
v-if="result"
v-masonry
transition-duration="0"
item-selector=".column"
percent-position="true"
stagger="0"
class="ui stackable three column doubling grid">
<div <div
v-masonry-tile
v-if="result.results.length > 0" v-if="result.results.length > 0"
v-for="radio in result.results" v-for="radio in result.results"
:key="radio.id" :key="radio.id"
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
</button> </button>
</div> </div>
<div class="ui hidden divider"></div> <div class="ui hidden divider"></div>
<p> <p v-if="batch">
Once all your files are uploaded, simply head over <router-link :to="{name: 'library.import.batches.detail', params: {id: batch.id }}">import detail page</router-link> to check the import status. Once all your files are uploaded, simply head over <router-link :to="{name: 'library.import.batches.detail', params: {id: batch.id }}">import detail page</router-link> to check the import status.
</p> </p>
<table class="ui single line table"> <table class="ui single line table">
...@@ -73,7 +73,7 @@ export default { ...@@ -73,7 +73,7 @@ export default {
data () { data () {
return { return {
files: [], files: [],
uploadUrl: 'import-jobs/', uploadUrl: '/api/v1/import-jobs/',
batch: null batch: null
} }
}, },
......
...@@ -5,10 +5,10 @@ ...@@ -5,10 +5,10 @@
<div class="description"> <div class="description">
<div <div
v-if="request.albums" v-html="$options.filters.markdown(request.albums)"></div> v-if="request.albums" v-html="$options.filters.markdown(request.albums)"></div>
<div v-if="request.comment" class="ui comments"> <div class="ui comments">
<comment <comment
:user="request.user" :user="request.user"
:content="request.comment" :content="request.comment || ''"
:date="request.creation_date"></comment> :date="request.creation_date"></comment>
</div> </div>
</div> </div>
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
@click="createImport" @click="createImport"
v-if="request.status === 'pending' && importAction && $store.state.auth.availablePermissions['import.launch']" v-if="request.status === 'pending' && importAction && $store.state.auth.availablePermissions['import.launch']"
class="ui mini basic green right floated button">Create import</button> class="ui mini basic green right floated button">Create import</button>
</div> </div>
</div> </div>
</template> </template>
......
...@@ -34,8 +34,16 @@ ...@@ -34,8 +34,16 @@
</div> </div>
</div> </div>
<div class="ui hidden divider"></div> <div class="ui hidden divider"></div>
<div v-if="result" class="ui stackable three column grid"> <div
v-if="result"
v-masonry
transition-duration="0"
item-selector=".column"
percent-position="true"
stagger="0"
class="ui stackable three column doubling grid">
<div <div
v-masonry-tile
v-if="result.results.length > 0" v-if="result.results.length > 0"
v-for="request in result.results" v-for="request in result.results"
:key="request.id" :key="request.id"
......
...@@ -9,6 +9,7 @@ import Vue from 'vue' ...@@ -9,6 +9,7 @@ import Vue from 'vue'
import App from './App' import App from './App'
import router from './router' import router from './router'
import axios from 'axios' import axios from 'axios'
import {VueMasonryPlugin} from 'vue-masonry'
import VueLazyload from 'vue-lazyload' import VueLazyload from 'vue-lazyload'
import store from './store' import store from './store'
import config from './config' import config from './config'
...@@ -24,7 +25,9 @@ window.$ = window.jQuery = require('jquery') ...@@ -24,7 +25,9 @@ window.$ = window.jQuery = require('jquery')
// play really nice with webpack and I want to get rid of Google Fonts // play really nice with webpack and I want to get rid of Google Fonts
// require('./semantic/semantic.css') // require('./semantic/semantic.css')
require('semantic-ui-css/semantic.js') require('semantic-ui-css/semantic.js')
require('masonry-layout')
Vue.use(VueMasonryPlugin)
Vue.use(VueLazyload) Vue.use(VueLazyload)
Vue.config.productionTip = false Vue.config.productionTip = false
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment