Merge pull request #395 from the1812/preview

Hotfix 2 for v1.10.12
This commit is contained in:
Grant Howard 2020-03-24 00:05:19 +08:00 committed by GitHub
commit 7bfcab4e18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 38 additions and 7 deletions

View File

@ -1,6 +1,6 @@
// ==UserScript== // ==UserScript==
// @name Bilibili Evolved (Offline) // @name Bilibili Evolved (Offline)
// @version 616.26 // @version 616.33
// @description Bilibili Evolved 的离线版, 所有功能都已内置于脚本中. // @description Bilibili Evolved 的离线版, 所有功能都已内置于脚本中.
// @author Grant Howard, Coulomb-G // @author Grant Howard, Coulomb-G
// @copyright 2020, Grant Howard (https://github.com/the1812) & Coulomb-G (https://github.com/Coulomb-G) // @copyright 2020, Grant Howard (https://github.com/the1812) & Coulomb-G (https://github.com/Coulomb-G)
@ -2758,7 +2758,13 @@ class ResourceManager {
url, url,
responseType: 'blob', responseType: 'blob',
})) }))
const latestVersion = await Ajax.monkey({ url: Resource.root + 'version.txt' }) let latestVersion
const zipVersion = zip.file('version.txt')
if (zipVersion) {
latestVersion = await zipVersion.async('text')
} else {
latestVersion = await Ajax.monkey({ url: (Resource.cdnRoot || Resource.root) + 'version.txt' })
}
isTimeout = false isTimeout = false
if (settings.currentVersion !== latestVersion) { if (settings.currentVersion !== latestVersion) {
console.log(`bundle version not match. current=${settings.currentVersion}, latest=${latestVersion}`) console.log(`bundle version not match. current=${settings.currentVersion}, latest=${latestVersion}`)

View File

@ -1,6 +1,6 @@
// ==UserScript== // ==UserScript==
// @name Bilibili Evolved (Preview Offline) // @name Bilibili Evolved (Preview Offline)
// @version 616.26 // @version 616.33
// @description Bilibili Evolved 的预览离线版, 可以抢先体验新功能, 并且所有功能都已内置于脚本中. // @description Bilibili Evolved 的预览离线版, 可以抢先体验新功能, 并且所有功能都已内置于脚本中.
// @author Grant Howard, Coulomb-G // @author Grant Howard, Coulomb-G
// @copyright 2020, Grant Howard (https://github.com/the1812) & Coulomb-G (https://github.com/Coulomb-G) // @copyright 2020, Grant Howard (https://github.com/the1812) & Coulomb-G (https://github.com/Coulomb-G)
@ -2758,7 +2758,13 @@ class ResourceManager {
url, url,
responseType: 'blob', responseType: 'blob',
})) }))
const latestVersion = await Ajax.monkey({ url: Resource.root + 'version.txt' }) let latestVersion
const zipVersion = zip.file('version.txt')
if (zipVersion) {
latestVersion = await zipVersion.async('text')
} else {
latestVersion = await Ajax.monkey({ url: (Resource.cdnRoot || Resource.root) + 'version.txt' })
}
isTimeout = false isTimeout = false
if (settings.currentVersion !== latestVersion) { if (settings.currentVersion !== latestVersion) {
console.log(`bundle version not match. current=${settings.currentVersion}, latest=${latestVersion}`) console.log(`bundle version not match. current=${settings.currentVersion}, latest=${latestVersion}`)

View File

@ -2817,7 +2817,13 @@ class ResourceManager {
url, url,
responseType: 'blob', responseType: 'blob',
})) }))
const latestVersion = await Ajax.monkey({ url: Resource.root + 'version.txt' }) let latestVersion
const zipVersion = zip.file('version.txt')
if (zipVersion) {
latestVersion = await zipVersion.async('text')
} else {
latestVersion = await Ajax.monkey({ url: (Resource.cdnRoot || Resource.root) + 'version.txt' })
}
isTimeout = false isTimeout = false
if (settings.currentVersion !== latestVersion) { if (settings.currentVersion !== latestVersion) {
console.log(`bundle version not match. current=${settings.currentVersion}, latest=${latestVersion}`) console.log(`bundle version not match. current=${settings.currentVersion}, latest=${latestVersion}`)

View File

@ -2817,7 +2817,13 @@ class ResourceManager {
url, url,
responseType: 'blob', responseType: 'blob',
})) }))
const latestVersion = await Ajax.monkey({ url: Resource.root + 'version.txt' }) let latestVersion
const zipVersion = zip.file('version.txt')
if (zipVersion) {
latestVersion = await zipVersion.async('text')
} else {
latestVersion = await Ajax.monkey({ url: (Resource.cdnRoot || Resource.root) + 'version.txt' })
}
isTimeout = false isTimeout = false
if (settings.currentVersion !== latestVersion) { if (settings.currentVersion !== latestVersion) {
console.log(`bundle version not match. current=${settings.currentVersion}, latest=${latestVersion}`) console.log(`bundle version not match. current=${settings.currentVersion}, latest=${latestVersion}`)

View File

@ -53,6 +53,7 @@ namespace BilibiliEvolved.Build
zip.CreateEntryFromFile(url, filename, CompressionLevel.NoCompression); zip.CreateEntryFromFile(url, filename, CompressionLevel.NoCompression);
hashDict.Add(filename, hash); hashDict.Add(filename, hash);
} }
zip.CreateEntryFromFile("version.txt", "version.txt", CompressionLevel.NoCompression);
} }
File.WriteAllText("min/bundle.json", JsonConvert.SerializeObject(hashDict, Formatting.Indented)); File.WriteAllText("min/bundle.json", JsonConvert.SerializeObject(hashDict, Formatting.Indented));
WriteSuccess("Bundle build complete."); WriteSuccess("Bundle build complete.");

Binary file not shown.

Binary file not shown.

View File

@ -266,7 +266,13 @@ export class ResourceManager {
url, url,
responseType: 'blob', responseType: 'blob',
})) }))
const latestVersion = await Ajax.monkey({ url: Resource.root + 'version.txt' }) let latestVersion
const zipVersion = zip.file('version.txt')
if (zipVersion) {
latestVersion = await zipVersion.async('text')
} else {
latestVersion = await Ajax.monkey({ url: (Resource.cdnRoot || Resource.root) + 'version.txt' })
}
isTimeout = false isTimeout = false
if (settings.currentVersion !== latestVersion) { if (settings.currentVersion !== latestVersion) {
console.log(`bundle version not match. current=${settings.currentVersion}, latest=${latestVersion}`) console.log(`bundle version not match. current=${settings.currentVersion}, latest=${latestVersion}`)