This commit is contained in:
Gregorio
2019-03-03 16:30:39 +01:00
parent cb35dfbe65
commit 668b259adb
23 changed files with 519 additions and 494 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 88 KiB

+11 -3
View File
@@ -10,17 +10,25 @@ export default class AboutUs extends Component {
<Col xs={12} sm={4} className="person-wrapper"> <Col xs={12} sm={4} className="person-wrapper">
<Image src="assets/person-1.jpg" roundedCircle className="profile-pic" /> <Image src="assets/person-1.jpg" roundedCircle className="profile-pic" />
<h3>Matteo Scorzafava</h3> <h3>Matteo Scorzafava</h3>
<p>That's a crooked tree. We'll send him to Washington. These little son of a guns hide in your brush and you just have to push them out.</p> <p></p>
</Col> </Col>
<Col xs={12} sm={4} className="person-wrapper"> <Col xs={12} sm={4} className="person-wrapper">
<Image src="assets/person-2.jpg" roundedCircle className="profile-pic" /> <Image src="assets/person-2.jpg" roundedCircle className="profile-pic" />
<h3>Simone Ferrari</h3> <h3>Simone Ferrari</h3>
<p>That's a crooked tree. We'll send him to Washington. These little son of a guns hide in your brush and you just have to push them out.</p> <p>Recommender Random<br/>
Recommender Related<br/>
Recommender Similarity Genere<br/>
Box delle informazioni relative al video
</p>
</Col> </Col>
<Col xs={12} sm={4} className="person-wrapper"> <Col xs={12} sm={4} className="person-wrapper">
<Image src="assets/person-3.jpg" roundedCircle className="profile-pic" /> <Image src="assets/person-3.jpg" roundedCircle className="profile-pic" />
<h3>Gregorio Giacchetti</h3> <h3>Gregorio Giacchetti</h3>
<p>That's a crooked tree. We'll send him to Washington. These little son of a guns hide in your brush and you just have to push them out.</p> <p>Recommender Recent<br/>
Recommender fvitali<br/>
Gestione della barra dei recommender<br/>
AboutUs
</p>
</Col> </Col>
</Row> </Row>
</Container> </Container>
+3 -1
View File
@@ -46,7 +46,9 @@ class App extends React.Component {
return { videoId: idMatch.params.id }; return { videoId: idMatch.params.id };
} }
return null; return null;
}}} }
}
}
-1
View File
@@ -1,5 +1,4 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Row, Col } from 'react-bootstrap';
import { Switch, Route } from 'react-router'; import { Switch, Route } from 'react-router';
import Random from './reccomenders/Random'; import Random from './reccomenders/Random';
import Related from './reccomenders/Related'; import Related from './reccomenders/Related';
+4 -2
View File
@@ -81,8 +81,10 @@ class VideoList extends React.Component {
return videoItem.videoID === resCurrentValue.id; return videoItem.videoID === resCurrentValue.id;
}), }),
'thumbnail', 'thumbnail',
{ value: resCurrentValue.snippet.thumbnails.medium.url, {
enumerable: true } value: resCurrentValue.snippet.thumbnails.medium.url,
enumerable: true
}
) )
); );
this.setState({ this.setState({
+4 -4
View File
@@ -19,7 +19,7 @@ class VideoPlayer extends React.Component {
origin//: 'http://site1854.tw.cs.unibo.it' origin//: 'http://site1854.tw.cs.unibo.it'
} }
}, },
promise1: Promise, promise1: null,
promise2: Promise, promise2: Promise,
outsideReject1: null, outsideReject1: null,
outsideReject2: null outsideReject2: null
@@ -101,8 +101,7 @@ class VideoPlayer extends React.Component {
let j = tmp.findIndex(el => el.id.toString() === videoIdWatched.toString()) let j = tmp.findIndex(el => el.id.toString() === videoIdWatched.toString())
if (j < 0) { if (j < 0) {
if (localStorage['prevId']==='1') if (localStorage['prevId'] === '1') {
{
//per primo video //per primo video
tmp.push({ tmp.push({
'id': videoIdWatched.toString(), 'id': videoIdWatched.toString(),
@@ -129,7 +128,8 @@ class VideoPlayer extends React.Component {
if (z < 0) { if (z < 0) {
tmp[j].prevVideos.push({ tmp[j].prevVideos.push({
'id': localStorage["prevId"].toString() 'id': localStorage["prevId"].toString()
})} })
}
} }
+1
View File
@@ -51,6 +51,7 @@ class RecommenderRandom extends Component{
<Link <Link
to={{ to={{
pathname: '/video/' + item.id.videoId, pathname: '/video/' + item.id.videoId,
search: "?ref=Random"
}} }}
> >
<Card.Img <Card.Img
+1 -1
View File
@@ -56,7 +56,6 @@ class Recent extends React.Component {
render() { render() {
const recentVideoList = JSON.parse(localStorage.getItem('lastWatched'))
const { error, isLoaded, items } = this.state; const { error, isLoaded, items } = this.state;
if (error) { if (error) {
return ( return (
@@ -77,6 +76,7 @@ class Recent extends React.Component {
<Link <Link
to={{ to={{
pathname: '/video/' + item.id, pathname: '/video/' + item.id,
search: "?ref=Recent"
}} }}
> >
<Card.Img <Card.Img
+1
View File
@@ -71,6 +71,7 @@ class Related extends Component {
<Link <Link
to={{ to={{
pathname: '/video/' + item.id.videoId, pathname: '/video/' + item.id.videoId,
search: "?ref=Related"
}} }}
> >
<Card.Img <Card.Img
+2 -1
View File
@@ -1,7 +1,7 @@
import React from 'react'; import React from 'react';
import axios from 'axios'; import axios from 'axios';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import { Card, Col, Media } from 'react-bootstrap'; import { Col, Media } from 'react-bootstrap';
class Search extends React.Component { class Search extends React.Component {
@@ -117,6 +117,7 @@ class Search extends React.Component {
as="li" className="media mx-5 my-1 suggItem" as="li" className="media mx-5 my-1 suggItem"
to={{ to={{
pathname: '/video/' + item.id.videoId, pathname: '/video/' + item.id.videoId,
search: "?ref=Search"
}}> }}>
<img <img
width={240} width={240}
+4 -2
View File
@@ -91,6 +91,7 @@ class fvitali extends React.Component {
<Link <Link
to={{ to={{
pathname: '/video/' + item.videoID, pathname: '/video/' + item.videoID,
search: "?ref=fvitali"
}} }}
> >
<Card.Img <Card.Img
@@ -118,7 +119,7 @@ class fvitali extends React.Component {
as="li" className="media mx-5 my-1 suggItem" as="li" className="media mx-5 my-1 suggItem"
to={{ to={{
pathname: `/video/${item.videoID}`, pathname: `/video/${item.videoID}`,
search: '?ref=fvitali587' search: '?ref=fvitali'
}}> }}>
<img <img
width={240} width={240}
@@ -135,7 +136,8 @@ class fvitali extends React.Component {
</Link> </Link>
)) ))
}</ul> }</ul>
);} );
}
} }
} }
} }
+2 -1
View File
@@ -1,6 +1,6 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import axios from 'axios'; import axios from 'axios';
import {Card, Col, Tab, Tabs} from "react-bootstrap"; import { Card, Col } from "react-bootstrap";
import createpageToken from 'youtube-page-token'; import createpageToken from 'youtube-page-token';
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";
import moment from "moment"; import moment from "moment";
@@ -50,6 +50,7 @@ class genreSimilarity extends Component {
<Link <Link
to={{ to={{
pathname: '/video/' + item.id.videoId, pathname: '/video/' + item.id.videoId,
search: "?ref=genreSimilarity"
}} }}
> >
<Card.Img <Card.Img
+2 -1
View File
@@ -76,7 +76,7 @@ class popGlobaleAssoluta extends React.Component {
render() { render() {
const { error, isLoaded, items, headers } = this.state; const { error, isLoaded, items } = this.state;
if (error) { if (error) {
return ( return (
<React.Fragment> <React.Fragment>
@@ -99,6 +99,7 @@ class popGlobaleAssoluta extends React.Component {
<Link <Link
to={{ to={{
pathname: '/video/' + item.videoID, pathname: '/video/' + item.videoID,
search: "?ref=popGlobaleAssoluta"
}} }}
> >
<Card.Img <Card.Img
+1
View File
@@ -89,6 +89,7 @@ class popLocaleAss extends React.Component {
as="li" className="media mx-5 my-1 suggItem" as="li" className="media mx-5 my-1 suggItem"
to={{ to={{
pathname: '/video/' + item.id, pathname: '/video/' + item.id,
search: "?ref=popLocaleAss"
}}> }}>
<img <img
width={240} width={240}
+3 -4
View File
@@ -21,10 +21,8 @@ class PopRelLoc extends React.Component {
let tmp = JSON.parse(localStorage.getItem('lastWatched')); let tmp = JSON.parse(localStorage.getItem('lastWatched'));
let j = tmp.findIndex(el => el.id === localStorage["lastId"]); let j = tmp.findIndex(el => el.id === localStorage["lastId"]);
//this.getThumbnailsNames(tmp[j].prevVideos); //this.getThumbnailsNames(tmp[j].prevVideos);
if (tmp.length === 0 || localStorage["prevId"] === '1') if (tmp.length === 0 || localStorage["prevId"] === '1') { this.getThumbnailsNames(JSON.parse(localStorage.getItem('first'))) }
{this.getThumbnailsNames(JSON.parse(localStorage.getItem('first')))} else { this.getThumbnailsNames(tmp[j].prevVideos) }
else
{this.getThumbnailsNames(tmp[j].prevVideos)}
} }
@@ -88,6 +86,7 @@ class PopRelLoc extends React.Component {
<Link <Link
to={{ to={{
pathname: '/video/' + item.id, pathname: '/video/' + item.id,
search: "?ref=popRelLoc"
}} }}
> >
<Card.Img <Card.Img
+8 -1
View File
@@ -37,12 +37,19 @@ class similarityArtist extends React.Component {
'key': 'AIzaSyA21Odw9UdfiOJnxvA_eDfOW0OxuUfHKig' 'key': 'AIzaSyA21Odw9UdfiOJnxvA_eDfOW0OxuUfHKig'
} }
}).then( }).then(
res => res => {
let j = res.data.items.findIndex(el => el.id.videoId === localStorage['lastId'])
if (j >= 0)
res.data.items.splice(j, 1);
this.setState({ this.setState({
res: res.data, res: res.data,
isLoaded: true isLoaded: true
}) })
console.log(res);
}
, ,
error => this.setState({ error => this.setState({
error error
}) })