Skip to content

Commit f812de8

Browse files
committed
Bugfixes
- Added offline mode - Native language (original) audio track is now used by default for YouTube videos - Fixed YouTube History tab
1 parent 99c6649 commit f812de8

File tree

18 files changed

+85
-27
lines changed

18 files changed

+85
-27
lines changed

NetStream-DE/download_enabler.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ static int ExportFilePatched(uint32_t *data)
4242
bgdl_path = paf::common::FormatString("ux0:bgdl/t/%08x/d0.pdb", num);
4343

4444
int ret = 0;
45-
paf::common::SharedPtr<paf::LocalFile> fd = paf::LocalFile::Open(bgdl_path.c_str(), SCE_O_RDONLY, 0, &ret);
45+
paf::common::SharedPtr<paf::LocalFile> fd = paf::LocalFile::Open(bgdl_path.c_str(), paf::File::RDONLY, 0, &ret);
4646
if (ret != SCE_PAF_OK)
4747
{
4848
return ret;
4949
}
5050

51-
fd->Seek(0xD6, SCE_SEEK_SET);
51+
fd->Seek(0xD6, paf::File::SET);
5252
fd->Read(&url_length, sizeof(uint16_t));
53-
fd->Seek(0xF7 + url_length, SCE_SEEK_SET);
53+
fd->Seek(0xF7 + url_length, paf::File::SET);
5454
fd->Read(file_name, sizeof(file_name));
5555
fd->Close();
5656

0 Bytes
Binary file not shown.
-162 Bytes
Binary file not shown.

NetStream/include/dialog.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ namespace dialog
6060
void Close();
6161

6262
void WaitEnd();
63+
64+
bool IsActive();
6365
};
6466

6567
#endif

NetStream/include/main.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ namespace menu {
3131

3232
private:
3333

34+
void OnDialogUserCancelEvent(int32_t type);
35+
3436
Type m_type;
3537
};
3638

NetStream/include/menus/menu_first.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ namespace menu {
4646

4747
void OnListButton(ui::Widget *self);
4848

49+
void SetOfflineMode();
50+
4951
MenuType GetMenuType() override
5052
{
5153
return MenuType_First;
@@ -60,6 +62,7 @@ namespace menu {
6062
private:
6163

6264
bool m_showHvdb;
65+
ui::ListView *m_rootList;
6366
};
6467
}
6568

NetStream/param.sfx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
22
<paramsfo>
3-
<param key="APP_VER">03.32</param>
3+
<param key="APP_VER">03.33</param>
44
<param key="ATTRIBUTE">33408</param>
55
<param key="ATTRIBUTE_MINOR">16</param>
66
<param key="ATTRIBUTE2">0</param>

NetStream/source/browsers/local_server_browser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ vector<LocalServerBrowser::Entry *> *LocalServerBrowser::GoTo(const char *ref, i
187187
char *begin = NULL;
188188
char *end = NULL;
189189

190-
fres = LocalFile::Open(GetPath().c_str(), SCE_O_RDONLY, 0, &res);
190+
fres = LocalFile::Open(GetPath().c_str(), File::RDONLY, 0, &res);
191191
if (res < 0)
192192
{
193193
*result = res;

NetStream/source/dialog.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,4 +256,12 @@ void dialog::WaitEnd()
256256
while (s_currentDialog != CURRENT_DIALOG_NONE) {
257257
thread::Sleep(100);
258258
}
259+
}
260+
261+
bool dialog::IsActive()
262+
{
263+
if (s_currentDialog == CURRENT_DIALOG_NONE)
264+
return false;
265+
266+
return true;
259267
}

NetStream/source/main.cpp

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ int32_t menu::main::NetcheckJob::Run()
6969
int32_t ret = SCE_OK;
7070
int32_t sync = 0;
7171
SceUID shellPid = SCE_UID_INVALID_UID;
72+
bool dialogAborted = false;
7273
char titleid[12];
7374
SceNetInitParam param;
7475

@@ -91,37 +92,59 @@ int32_t menu::main::NetcheckJob::Run()
9192
param.memory = sce_paf_malloc(SCE_KERNEL_32KiB);
9293
param.size = SCE_KERNEL_32KiB;
9394
param.flags = 0;
95+
9496
ret = sceNetInit(&param);
9597
while (ret != SCE_OK)
9698
{
99+
if (!dialog::IsActive() || dialogAborted)
100+
{
101+
dialog::OpenError(g_appPlugin, SCE_ERROR_ERRNO_ECANCELED, Framework::Instance()->GetCommonString("msg_error_network_connection"));
102+
dialogAborted = true;
103+
break;
104+
}
97105
ret = sceNetInit(&param);
98106
thread::Sleep(100);
99107
}
100108

101109
ret = sceNetCtlInit();
102110
while (ret != SCE_OK)
103111
{
112+
if (!dialog::IsActive() || dialogAborted)
113+
{
114+
dialog::OpenError(g_appPlugin, SCE_ERROR_ERRNO_ECANCELED, Framework::Instance()->GetCommonString("msg_error_network_connection"));
115+
dialogAborted = true;
116+
break;
117+
}
104118
ret = sceNetCtlInit();
105119
thread::Sleep(100);
106120
}
107121

108122
sceNetCtlInetGetState(&ret);
109123
while (ret != SCE_NET_CTL_STATE_IPOBTAINED)
110124
{
125+
if (!dialog::IsActive() || dialogAborted)
126+
{
127+
dialog::OpenError(g_appPlugin, SCE_ERROR_ERRNO_ECANCELED, Framework::Instance()->GetCommonString("msg_error_network_connection"));
128+
dialogAborted = true;
129+
break;
130+
}
111131
sceNetCtlInetGetState(&ret);
112132
thread::Sleep(100);
113133
}
114134

115135
menu::Settings::Init();
116136

117-
ytutils::Init(NP_TUS_HIST_LOG_SLOT, NP_TUS_FAV_LOG_SLOT);
118-
hvdbutils::Init();
137+
if (!dialogAborted)
138+
{
139+
ytutils::Init(NP_TUS_HIST_LOG_SLOT, NP_TUS_FAV_LOG_SLOT);
140+
hvdbutils::Init();
119141

120-
dialog::Close();
142+
dialog::Close();
143+
}
121144

122145
sce::AppSettings *settings = menu::Settings::GetAppSetInstance();
123146
settings->GetInt("cloud_sync", static_cast<int32_t *>(&sync), 0);
124-
if (sync)
147+
if (sync && !dialogAborted)
125148
{
126149
nputils::PreInit(OnNpDialogComplete);
127150
}
@@ -133,6 +156,14 @@ int32_t menu::main::NetcheckJob::Run()
133156
taiLoadStartModuleForPid(shellPid, pluginPath.c_str(), 0, NULL, 0);
134157
}
135158

159+
if (dialogAborted)
160+
{
161+
menu::First *fmenu = static_cast<menu::First *>(menu::GetTopMenu());
162+
thread::RMutex::MainThreadMutex()->Lock();
163+
fmenu->SetOfflineMode();
164+
thread::RMutex::MainThreadMutex()->Unlock();
165+
}
166+
136167
return SCE_PAF_OK;
137168
}
138169

@@ -148,7 +179,7 @@ void pluginLoadCB(Plugin *plugin)
148179

149180
Framework *fw = Framework::Instance();
150181

151-
dialog::OpenPleaseWait(g_appPlugin, NULL, fw->GetCommonString("msg_wait"));
182+
dialog::OpenPleaseWait(g_appPlugin, NULL, fw->GetCommonString("msg_connecting_wait"), true);
152183

153184
menu::main::NetcheckJob *ncJob = new menu::main::NetcheckJob(menu::main::NetcheckJob::Type_Initial);
154185
common::SharedPtr<job::JobItem> itemParam(ncJob);

0 commit comments

Comments
 (0)