Skip to content

Commit

Permalink
Updated v0.14.4
Browse files Browse the repository at this point in the history
此版本更新内容如下:

新增 全新手动添加媒体界面
新增 手动添加媒体时支持输入作品名自动匹配媒体信息
新增 手动添加媒体时支持通过对话框选择媒体路径
新增 启动后自动更新媒体信息功能(实验性)
新增 启动后自动扫描媒体库更改功能
新增 截屏海报分享功能(实验性)
优化 媒体库更改扫描性能

修复 媒体库增量扫描后显示错误的问题
修复 清空媒体库时报错的问题
修复 媒体库搜索界面标题过长排版错误的问题
修复 进入媒体详情页面时评分星星不显示或者显示错乱的问题
  • Loading branch information
JimHans committed Apr 22, 2023
1 parent f35f219 commit d6c64bd
Show file tree
Hide file tree
Showing 10 changed files with 368 additions and 40 deletions.
6 changes: 3 additions & 3 deletions includes/stars.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
aspect-ratio: 1;
height: 70%;
/* background-size: 25px 25px; */
background-size: cover;
background-size: contain;
margin-right: 10px;
background-image: url(../assets/stars/fullstar.png);
}
Expand All @@ -12,7 +12,7 @@
aspect-ratio: 1;
height: 70%;
/* background-size: 25px 25px; */
background-size: cover;
background-size: contain;
margin-right: 10px;
background-image: url('../assets/stars/emptystar.png');
}
Expand All @@ -21,7 +21,7 @@
aspect-ratio: 1;
height: 70%;
/* background-size: 25px 25px; */
background-size: cover;
background-size: contain;
margin-right: 10px;
background-image: url('../assets/stars/halfstar.png');
}
15 changes: 9 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
<title>bgm.res</title>
<style>
</style>
<script>
<script> //重定向NodeRequire以引入JQuery
window.nodeRequire = require;
delete window.require;
delete window.exports;
delete window.module;
</script> <!--重定向NodeRequire以引入JQuery-->
<script src="./includes/jquery-min.js"></script>
<script src="./js/ping.js"></script>
</script>
<script src="./includes/jquery-min.js"></script> <!--引入JQuery-->
<script src="./js/ping.js"></script> <!--Ping模块-->
</head>


Expand All @@ -26,6 +26,7 @@
<img src="./assets/app.png" width="25" height="25" style="position: absolute;line-height: 26px;margin: 4px 0px 0px 5px;left:5px;">
<img src="./assets/bgm.res.png" height="17" style="position: absolute;line-height: 26px;margin: 7px 0px 0px 5px;left:40px;aspect-ratio:4.63">
<a id="Title" style="height: 30px;line-height: 30px;position:absolute;left:30%;right:30%;text-align: center;">bgm.res</a>
<div class="hider" onclick="ArchiveMediaDetailsPageShare()" title="分享" style="right:140px;position:absolute;background-image: unset;"><svg t="1682171029405" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2648" width="20" height="30"><path d="M742 658.3c-35.5 0-67.7 13.6-90.9 35.7L408.4 547.5c0.3-3.4 0.5-6.6 0.5-10.1 0-20-5.2-38.7-14.3-55.3l205.7-149.2c23.2 21.8 55.1 35.2 90.4 35.2 70.7 0 128.1-54.2 128.1-120.9 0-66.8-57.4-120.9-128.1-120.9-70.8 0-128.1 54.2-128.1 120.9 0 5.5 0.4 11.1 1.2 16.4L336.5 428.5c-16.8-7.7-35.8-12-55.8-12-70.8 0-128.2 54.2-128.2 120.9s57.4 120.9 128.2 120.9c35.5 0 67.7-13.6 90.9-35.7L614.3 769c-0.3 3.4-0.4 6.7-0.4 10.1 0 66.8 57.4 120.9 128.1 120.9 70.8 0 128.2-54.2 128.2-120.9S812.7 658.3 742 658.3z m0 0" fill="#ffffff" p-id="2649"></path></svg></div>
<!-- <div class="cross" onclick="Closer()"></div>
<div class="hider" onclick="Hider()"></div> 不需要的自定义container-->
</div>
Expand Down Expand Up @@ -205,8 +206,8 @@ <h2 style="margin-top:15px;margin-bottom:15px;margin-left:16px;"> 媒体库设
<div class="Winui3brickContainer">设定媒体库目录<input class="Winui3inputText" type="text" name="checkboxA" placeholder="填写你的媒体库目录" style="width:50%;right: 60px;" required><button type='button' value='保存' class='Winui3button' style='width:30px' onclick='SettingsPageSaveConfig("checkboxA",0,"LocalStorageMediaBaseURL","fillblank")'><svg t="1674212097751" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3806" width="20" height="20"><path d="M704 128H192c-35.2 0-64 28.8-64 64v640c0 35.2 28.8 64 64 64h640c35.2 0 64-28.8 64-64V320L704 128zM256 256h320v128H256V256z m256 512c-70.4 0-128-57.6-128-128s57.6-128 128-128 128 57.6 128 128-57.6 128-128 128z" p-id="3807" fill="#e6e6e6"></path></svg></button></div>
<div class="Winui3brickContainer"><div>手动重新扫描<br><a class="Winui3brickSubtitle" style="font-size: 13px;margin-top:2px;">手动重新对媒体库进行全局扫描,将覆盖现有数据</a></div><button type="button" value="点击扫描" class="Winui3button" onclick="LocalWorkScan();">点击扫描</button></div>
<div class="Winui3brickContainer"><div>手动更新媒体库信息<br><a class="Winui3brickSubtitle" style="font-size: 13px;margin-top:2px;">手动重新对所有媒体信息进行匹配更新,将覆盖现有数据</a></div><button type="button" value="点击刷新" class="Winui3button" onclick="ArchiveMediaUpdate()">点击刷新</button></div>
<div class="Winui3brickContainer">启动后自动更新媒体库(暂不可用)<label class="Winui3switch"><input class="Winui3input" type="checkbox" name="checkboxA" value="AutoUpdateArchive" onchange='SettingsPageSaveConfig("checkboxA",1,"LocalStorageAutoUpdateArchive","checkbox")'><div class="Winui3slider"></div></label></div>
<div class="Winui3brickContainer">启动后媒体库自动增量扫描<label class="Winui3switch"><input class="Winui3input" type="checkbox" name="checkboxA" value="AutoUpdateArchiveInfo" onchange='SettingsPageSaveConfig("checkboxA",2,"LocalStorageAutoUpdateArchiveInfo","checkbox")'><div class="Winui3slider"></div></label></div>
<div class="Winui3brickContainer">启动后媒体库自动增量扫描<label class="Winui3switch"><input class="Winui3input" type="checkbox" name="checkboxA" value="AutoUpdateArchive" onchange='SettingsPageSaveConfig("checkboxA",1,"LocalStorageAutoUpdateArchive","checkbox")'><div class="Winui3slider"></div></label></div>
<div class="Winui3brickContainer">启动后自动更新媒体库(实验)<label class="Winui3switch"><input class="Winui3input" type="checkbox" name="checkboxA" value="AutoUpdateArchiveInfo" onchange='SettingsPageSaveConfig("checkboxA",2,"LocalStorageAutoUpdateArchiveInfo","checkbox")'><div class="Winui3slider"></div></label></div>
<div class="Winui3brickContainer"><div>设定字幕文件夹(暂不可用)<br><a class="Winui3brickSubtitle" style="font-size: 13px;margin-top:2px;">设定后,系统将自动在媒体库显示该文件夹,方便调用字幕</a></div>
<input class="Winui3inputText" type="text" name="checkboxA" placeholder="填写字幕文件夹名称" style="right: 60px;" required><button type='button' value='保存' class='Winui3button' style='width:30px' onclick='SettingsPageSaveConfig("checkboxA",3,"LocalStorageMediaSubFolderName","fillblank")'><svg t="1674212097751" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3806" width="20" height="20"><path d="M704 128H192c-35.2 0-64 28.8-64 64v640c0 35.2 28.8 64 64 64h640c35.2 0 64-28.8 64-64V320L704 128zM256 256h320v128H256V256z m256 512c-70.4 0-128-57.6-128-128s57.6-128 128-128 128 57.6 128 128-57.6 128-128 128z" p-id="3807" fill="#e6e6e6"></path></svg></button></div>
<!-- 网络探针 全按钮 -->
Expand Down Expand Up @@ -350,6 +351,8 @@ <h2 style="margin-top:15px;margin-bottom:15px;margin-left:16px;">🚀 关于bgm.
<script src="./js/SettingsPage.js"></script>
<!-- 登录请求&用户数据获取 -->
<script src="./js/UserAuth.js"></script>
<!--分享模块-->
<script src="./js/Mainpage_Modules/MediaBannerShare.js"></script>

<!-- 作品详情章节点击展开/收起 -->
<script> //作品详情卡片控件
Expand Down
53 changes: 51 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ var packageGet = require("./package.json");
require('@electron/remote/main').initialize(); //初始化dialog renderer
const Store = require('electron-store'); Store.initRenderer(); //初始化electron-store
let userpage = null;/*用户页面全局对象*/
let AddMediaPage = null;/*添加媒体页面全局对象*/

function createWindow () {
//获取屏幕分辨率
Expand Down Expand Up @@ -122,7 +123,7 @@ ipcMain.on("dev",(event,data) => {
ipcMain.on('MediaSettings', (event, arg) => {
// 创建子页面
let setwidth = screenElectron.getPrimaryDisplay().workAreaSize.width;
var MediaSettings = new BrowserWindow({
let MediaSettings = new BrowserWindow({
width: parseInt((setwidth/2)*(6/5)),
height: parseInt((setwidth/2)*(3/4)),
minWidth: 500,
Expand All @@ -145,7 +146,7 @@ ipcMain.on('MediaSettings', (event, arg) => {
contextIsolation: false,
}
});
MediaSettings.loadFile('MediaSettings.html');// 并且为你的应用加载index.html
MediaSettings.loadFile('./pages/MediaSettings.html');// 并且为你的应用加载index.html
require('@electron/remote/main').enable(MediaSettings.webContents) // 启用 electron/remote web组件
// MediaSettings.webContents.openDevTools();
MediaSettings.on('ready-to-show', function () {
Expand All @@ -155,6 +156,7 @@ ipcMain.on('MediaSettings', (event, arg) => {
MediaSettings.on('closed', () => { MediaSettings = null });
});

//用户信息页初始化函数
function userpageShow () {
//窗口打开监听
var setheight = screenElectron.getPrimaryDisplay().workAreaSize.height;
Expand Down Expand Up @@ -198,6 +200,53 @@ ipcMain.on("userpage",(event,data) => {
if(data == 'Close') {event.preventDefault(); userpage.close();}
});

//添加媒体页初始化函数
function AddMediaPageShow () {
// 创建子页面
let setwidth = screenElectron.getPrimaryDisplay().workAreaSize.width;
AddMediaPage = new BrowserWindow({
width: parseInt((setwidth/2)*(6/5)),
height: parseInt((setwidth/2)*(3/4)),
minWidth: 500,
minHeight: 360,
skipTaskbar: false,//显示在任务栏
alwaysOnTop: false,//置顶显示
transparent: false,//底部透明
frame: true,
titleBarStyle: "hidden",
titleBarOverlay: {
color: "#202020",
symbolColor: "white", },
resizable: true,
icon: path.join(__dirname, './assets/app.ico'),
show: true,
webPreferences: {
devTools: true,
nodeIntegration: true,
enableRemoteModule: true,
contextIsolation: false,
}
});
AddMediaPage.loadFile('./pages/AddMediaPage.html');// 并且为你的应用加载index.html
require('@electron/remote/main').enable(AddMediaPage.webContents) // 启用 electron/remote web组件
//AddMediaPage.webContents.openDevTools();
AddMediaPage.on('ready-to-show', function () {
AddMediaPage.webContents.send('data','OK'); // 发送消息
AddMediaPage.show() // 初始化后再显示
});
AddMediaPage.on('closed', () => { AddMediaPage = null });
}

//监听添加作品页打开信号
ipcMain.on("AddMediaPage",(event,data) => {
console.log(data);
if(data == 'Open') {
if(AddMediaPage==null||AddMediaPage.isDestroyed()){AddMediaPageShow ();}
else {AddMediaPage.show();}
}
if(data == 'Close') {event.preventDefault(); AddMediaPage.close();}
});

// // alternatively use these to
// // dynamically change vibrancy
// win.setVibrancy([options])
Expand Down
Loading

0 comments on commit d6c64bd

Please sign in to comment.