Archived
Merge branch 'layout1' of https://bitbucket.org/sco44/tecnologiabanana into layout1
This commit is contained in:
+40
-1
@@ -59,7 +59,46 @@ low(new FileAsync(__dirname + '/db.json')) // production
|
|||||||
res.set({
|
res.set({
|
||||||
'Access-Control-Allow-Origin': '*'
|
'Access-Control-Allow-Origin': '*'
|
||||||
});
|
});
|
||||||
req.query.id ? res.send(req.query.id) : res.status(400).send('Bad Request');
|
const videos1 = db.get('videos');
|
||||||
|
let videos = JSON.parse(JSON.stringify(videos1.values()));
|
||||||
|
if (req.query.id) {
|
||||||
|
let tmpRes;
|
||||||
|
let row = videos1.getById(req.query.id);
|
||||||
|
if (row.value()) {
|
||||||
|
let tmpA = videos.filter(x => x.id !== req.query.id).map(x => {
|
||||||
|
return {
|
||||||
|
"videoId": x.id,
|
||||||
|
"timesWatched": x.timesWatched,
|
||||||
|
"prevalentReason": x.reason.sort((a, b) => a.timesWatched - b.timesWatched).reverse()[0].reason,
|
||||||
|
"lastSelected": x.lastWatched
|
||||||
|
}
|
||||||
|
})
|
||||||
|
tmpRes = {
|
||||||
|
"site": "site1854.tw.cs.unibo.it",
|
||||||
|
"recommender": req.query.id.toString(),
|
||||||
|
"lastWatched": row.value().lastWatched,
|
||||||
|
"recomended": tmpA
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
let tmpA = videos.map(x => {
|
||||||
|
return {
|
||||||
|
"videoId": x.id,
|
||||||
|
"timesWatched": x.timesWatched,
|
||||||
|
"prevalentReason": x.reason.sort((a, b) => a.timesWatched - b.timesWatched).reverse()[0].reason,
|
||||||
|
"lastSelected": x.lastWatched
|
||||||
|
}
|
||||||
|
})
|
||||||
|
tmpRes = {
|
||||||
|
"site": "site1854.tw.cs.unibo.it",
|
||||||
|
"recommender": req.query.id.toString(),
|
||||||
|
"lastWatched": "Never Watched",
|
||||||
|
"recomended": tmpA
|
||||||
|
}
|
||||||
|
}
|
||||||
|
res.send(tmpRes)
|
||||||
|
} else
|
||||||
|
res.status(400).send('Bad Request');
|
||||||
});
|
});
|
||||||
|
|
||||||
// OPTIONS /videotrack
|
// OPTIONS /videotrack
|
||||||
|
|||||||
+1
-1
@@ -54,7 +54,7 @@ class Wikipedia extends Component {
|
|||||||
const musicbrainzBaseUrl = "https://musicbrainz.org/ws/2"; // more readable
|
const musicbrainzBaseUrl = "https://musicbrainz.org/ws/2"; // more readable
|
||||||
let artist = this.props.artist || this.props.artist2;
|
let artist = this.props.artist || this.props.artist2;
|
||||||
let title = this.props.title || this.props.title2;
|
let title = this.props.title || this.props.title2;
|
||||||
console.log('porcodio', P175.toLowerCase(), artist.trim().toLowerCase(), P175.toLowerCase() === artist.trim().toLowerCase())
|
console.log('accipicchia', P175.toLowerCase(), artist.trim().toLowerCase(), P175.toLowerCase() === artist.trim().toLowerCase())
|
||||||
if (P175.toLowerCase() === artist.trim().toLowerCase()) {
|
if (P175.toLowerCase() === artist.trim().toLowerCase()) {
|
||||||
axios
|
axios
|
||||||
.get(`https://musicbrainz.org/ws/2/recording`, {
|
.get(`https://musicbrainz.org/ws/2/recording`, {
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ class popGlobaleAssoluta extends React.Component {
|
|||||||
|
|
||||||
|
|
||||||
// let listSiti = ['1828', '1829', '1838', '1839', '1846', '1822', '1847', '1831', '1827', '1848', '1824', '1830', '1836', '1850', '1849', '1851', '1861', '1823', '1863', '1834', '1904', '1906', '1901', '1862', '1859'];
|
// let listSiti = ['1828', '1829', '1838', '1839', '1846', '1822', '1847', '1831', '1827', '1848', '1824', '1830', '1836', '1850', '1849', '1851', '1861', '1823', '1863', '1834', '1904', '1906', '1901', '1862', '1859'];
|
||||||
let listSiti = ['1828', '1838', '1839', '1846', '1847', '1831', '1827', '1849', '1823', '1863', '1834', '1901', '1859'];
|
let listSiti = ['1828', '1838', '1839', '1846', '1831', '1827', '1849', '1823', '1863', '1834', '1901', '1859'];
|
||||||
let axiosReq = [];
|
let axiosReq = [];
|
||||||
for (let i = 0; i < listSiti.length; i++) {
|
for (let i = 0; i < listSiti.length; i++) {
|
||||||
console.log(`http://site${listSiti[i]}.tw.cs.unibo.it/globpop`)
|
console.log(`http://site${listSiti[i]}.tw.cs.unibo.it/globpop`)
|
||||||
|
|||||||
Reference in New Issue
Block a user