Archived
Merge branch 'layout1' of https://bitbucket.org/sco44/tecnologiabanana into layout1
This commit is contained in:
+17
-6
@@ -73,7 +73,7 @@ class Wikipedia extends Component {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(resRecordingQuery => {
|
.then(resRecordingQuery => {
|
||||||
let musicbrainzWorkId = resRecordingQuery.data.relations.map(x => x['target-type'] === 'work' ? x.work.id : "").toString() || P435;
|
let musicbrainzWorkId = resRecordingQuery.data.relations.map(x => x['target-type'] === 'work' ? x.work.id.toString() : "") || P435.toString();
|
||||||
axios.get(`${musicbrainzBaseUrl}/work/${musicbrainzWorkId}`, {
|
axios.get(`${musicbrainzBaseUrl}/work/${musicbrainzWorkId}`, {
|
||||||
params:{
|
params:{
|
||||||
'inc': 'artist-rels url-rels',
|
'inc': 'artist-rels url-rels',
|
||||||
@@ -108,7 +108,7 @@ class Wikipedia extends Component {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(resRecordingQuery => {
|
.then(resRecordingQuery => {
|
||||||
let musicbrainzWorkId = resRecordingQuery.data.relations.map(x => x['target-type'] === 'work' ? x.work.id : "").toString() || P435;
|
let musicbrainzWorkId = resRecordingQuery.data.relations.map(x => x['target-type'] === 'work' ? x.work.id.toString() : "") || P435.toString();
|
||||||
axios.get(`${musicbrainzBaseUrl}/work/${musicbrainzWorkId}`, {
|
axios.get(`${musicbrainzBaseUrl}/work/${musicbrainzWorkId}`, {
|
||||||
params:{
|
params:{
|
||||||
'inc': 'artist-rels url-rels',
|
'inc': 'artist-rels url-rels',
|
||||||
@@ -148,11 +148,17 @@ class Wikipedia extends Component {
|
|||||||
wikidataQ: resQ.data.entities,
|
wikidataQ: resQ.data.entities,
|
||||||
isWDataLoaded: true
|
isWDataLoaded: true
|
||||||
})
|
})
|
||||||
try{this.getMusicBrainzFromWData(resQ.data.entities[wikidatatmp.claims.P175[0].mainsnak.datavalue.value.id].labels.en.value,
|
try{
|
||||||
wikidatatmp.claims.P435[0].mainsnak.datavalue.value);
|
this.getMusicBrainzFromWData(
|
||||||
|
resQ.data.entities[wikidatatmp.claims.P175[0].mainsnak.datavalue.value.id].labels.en.value,
|
||||||
|
wikidatatmp.claims.P435[0].mainsnak.datavalue.value
|
||||||
|
);
|
||||||
}
|
}
|
||||||
catch{
|
catch(e){
|
||||||
console.error('no music')
|
console.error(e)
|
||||||
|
this.getMusicBrainzFromWData(
|
||||||
|
resQ.data.entities[wikidatatmp.claims.P175[0].mainsnak.datavalue.value.id].labels.en.value
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
if (wikidatatmp.sitelinks.enwiki)
|
if (wikidatatmp.sitelinks.enwiki)
|
||||||
@@ -199,7 +205,12 @@ class Wikipedia extends Component {
|
|||||||
let title = this.props.title || this.props.title2;
|
let title = this.props.title || this.props.title2;
|
||||||
axios.get(wdk.searchEntities(`${title.trim()}`))
|
axios.get(wdk.searchEntities(`${title.trim()}`))
|
||||||
.then(wikidataSearchRes => {
|
.then(wikidataSearchRes => {
|
||||||
|
try{
|
||||||
this.getWikidataPage(wikidataSearchRes.data.search[0].title)
|
this.getWikidataPage(wikidataSearchRes.data.search[0].title)
|
||||||
|
}
|
||||||
|
catch(e){
|
||||||
|
console.error(e)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user