Skip to content

Commit

Permalink
fix HB-Store PS5 file path and add fallback and file ps5 url path enf…
Browse files Browse the repository at this point in the history
…orcement
  • Loading branch information
Gkiokan committed Feb 24, 2024
1 parent 295dbac commit c88187d
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/renderer/pages/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,9 @@ export default {
async start(file){
// ps5 version
if( this.isPS5 ){
if( this.isPS5 ){
this.log(file.name + ' install request')
return await this.$ps5.install(file)
.then( (data) => {
// this.$message({ message: file.name + ' send to PS5', file, type: "info" })
Expand Down
11 changes: 11 additions & 0 deletions src/renderer/plugins/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,17 @@ let o = {
// let filePath = item.file.replace('attachments/', 'attachments/stream/')
let filePath = item.file ? item.file.replace('https', 'http') : item.file

// file url if we have missing ps4 default pacakage but file_ps5 given instead
// so fallback to file_ps5 if file is empty
if( !item.file && item.file_ps5){
filePath = item.file_ps5 ? item.file_ps5.replace('https', 'http') : item.file_ps5
}

// if we have ps5 selected enforce ps5 file
if( store.getters['app/isPS5'] && item.file_ps5 ){
filePath = item.file_ps5 ? item.file_ps5.replace('https', 'http') : item.file_ps5
}

return {
name: item.name,
status: 'remote',
Expand Down
3 changes: 2 additions & 1 deletion src/renderer/plugins/ps4.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,8 @@ let ps4 = {

install(file){
if(!file.url){
return console.log("Cannot find path for file " + file.name )
return new Promise( (resolve, reject) => reject("Can't find file URL for " + file.name) )
// return console.log("Cannot find path for file " + file.name )
}

return this.request(this.getURL() + '/api/install', { type : 'direct', packages: [file.url] }, { timeout: this.getTimeout() })
Expand Down
7 changes: 5 additions & 2 deletions src/renderer/plugins/ps5.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ let ps5 = {

// #todo refactor to ps5
getURL(of='ps'){
if(of == 'url'){
return store.getters['app/getPS4IP']
}

if(of == 'ps'){
let url = store.getters['app/getPS4IP']
Expand Down Expand Up @@ -134,7 +137,7 @@ let ps5 = {
console.error('Socket error:', error);

if( error.code == 'ECONNREFUSED' )
return reject("PS5 Connection failed at " + this.getURL('url') )
return reject(`PS5 Connection failed at ${this.getURL('url')}`)

reject(error);
});
Expand Down Expand Up @@ -171,7 +174,7 @@ let ps5 = {

install(file, cb=null){
if(!file.url){
return console.log("Cannot find path for file " + file.name )
return new Promise( (resolve, reject) => reject("Can't find file URL for " + file.name) )
}

return this.send({ url: file.url })
Expand Down

0 comments on commit c88187d

Please sign in to comment.