Skip to content

Commit

Permalink
Say hey to V2
Browse files Browse the repository at this point in the history
  • Loading branch information
z-jack committed Jun 23, 2018
1 parent 6fddc2f commit 96c3254
Show file tree
Hide file tree
Showing 21 changed files with 1,093 additions and 188 deletions.
1 change: 1 addition & 0 deletions .electron-vue/webpack.main.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ let mainConfig = {
* Adjust mainConfig for development settings
*/
if (process.env.NODE_ENV !== 'production') {
mainConfig.devtool = 'source-map'
mainConfig.plugins.push(
new webpack.DefinePlugin({
'__static': `"${path.join(__dirname, '../static').replace(/\\/g, '\\\\')}"`
Expand Down
1 change: 1 addition & 0 deletions .electron-vue/webpack.renderer.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ let rendererConfig = {
* Adjust rendererConfig for development settings
*/
if (process.env.NODE_ENV !== 'production') {
rendererConfig.devtool = 'source-map'
rendererConfig.plugins.push(
new webpack.DefinePlugin({
'__static': `"${path.join(__dirname, '../static').replace(/\\/g, '\\\\')}"`
Expand Down
109 changes: 96 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

> Manage the local movies
#### Build Setup
## Build Setup

``` bash
# install dependencies
Expand All @@ -25,7 +25,26 @@ P.S. The node module `drivelist` may need rebuild (`electron-builder install-app

如果出现无法build的情况请为npm设置代理服务器。

#### Config.JSON Structure
## Release Note

### V2.0.0

* Add logo for app
* Add integration of [douban](https://movie.douban.com) services
* Add shortcuts for searching subtitles
* Fix cannot add the same directory just deleted
* Fix cannot generate screenshots properly
* Optimize the config JSON structure
* Optimize using experience

### V1.0.0

* The explorer of local movies
* Auto-generate screenshots for movies

## Config.JSON Structure

### V1 (deprecated)

``` json
{
Expand Down Expand Up @@ -82,17 +101,81 @@ P.S. The node module `drivelist` may need rebuild (`electron-builder install-app

Due to binding to USB device dynamically, change the number of usb partition will cause corresponding data loss.

#### Todo List

- [ ] Test Available Video Formats
- [ ] Theme
- [ ] Recursive Directory Index
- [ ] Customize Sort
- [ ] Efficient Thumbnail
- [ ] Rebind USB + Thumbnail Rename
- [ ] Clear Thumbnail
- [ ] i18n
- [ ] Performance
### V2 (can migrate from V1)

``` json
{
"version": "2.0",
"theme": "light",
"VF": [0, 2, 4],
"ffmpeg": "path/to/ffmpeg/executable/file",
"volumes": [
{
"isPortable": false,
"volume": "D:\\",
"uuid": "somethingIdForVolume",
"directories": [
{
"path": "path/to/your/directory",
"uuid": "somethingIdForPath"
}
]
},
{
"isPortable": true,
"description": "WD Elements 10B8 USB Device",
"mountIndex": 0,
"partitions": 1,
"size": 2000365289472,
"uuid": "somethingIdForVolume",
"directories": [
{
"path": "path/to/your/directory",
"uuid": "somethingIdForPath"
}
]
}
],
"files": [
{
"uuid": "somethingIdForFile",
"fileName": "something中文.ext",
"nameSlice": [
["something"],
["", "zhong"],
["", "wen"]
],
"hasViewed": true
}
],
"locates": [
{
"vid": "somethingIdForVolume",
"pid": "somethingIdForPath",
"fid": "somethingIdForFile"
}
],
"binds": [
{
"fid": "somethingIdForFile",
"did": "somethingIdForDouban"
}
]
}
```

## Todo List

* [ ] Migrate to SQLite
* [ ] Test Available Video Formats
* [ ] Theme
* [ ] Recursive Directory Index
* [ ] Customize Sort
* [ ] Efficient Thumbnail
* [ ] Rebind USB + Thumbnail Rename
* [ ] Clear Thumbnail
* [ ] i18n
* [ ] Performance

---

Expand Down
Binary file added build/icons/1024x1024.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/icons/16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified build/icons/256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/icons/64x64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified build/icons/icon.icns
Binary file not shown.
Binary file modified build/icons/icon.ico
Binary file not shown.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "movie-finder",
"version": "1.0.4",
"version": "2.0.0",
"author": "JackZ <[email protected]>",
"description": "An electron-vue project",
"license": null,
Expand Down Expand Up @@ -57,7 +57,6 @@
"file-url": "^2.0.2",
"fs": "0.0.1-security",
"fuzzy": "^0.1.3",
"is-valid-path": "^0.1.1",
"iview": "^2.9.2",
"md5": "^2.2.1",
"pinyin": "^2.8.3",
Expand Down
18 changes: 15 additions & 3 deletions src/main/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { app, BrowserWindow } from 'electron'
import { app, BrowserWindow, session } from 'electron'

/**
* Set `__static` path to static files in production
Expand All @@ -21,8 +21,8 @@ function createWindow() {
height: 720,
useContentSize: true,
width: 1280,
minHeight: 500,
minWidth: 800,
minHeight: 700,
minWidth: 1024,
webPreferences: { webSecurity: false }
})

Expand All @@ -34,6 +34,18 @@ function createWindow() {
mainWindow = null
})

session.defaultSession.webRequest.onBeforeSendHeaders((d, c) => {
d.requestHeaders['User-Agent'] = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.79 Safari/537.36'
d.requestHeaders['Referer'] = d.url
if(d.requestHeaders['X-Rewrite'] !== undefined) {
let xHeaders = JSON.parse(d.requestHeaders['X-Rewrite'])
for(let key in xHeaders){
d.requestHeaders[key] = xHeaders[key]
}
delete d.requestHeaders['X-Rewrite']
}
c({ cancel: false, requestHeaders: d.requestHeaders })
})
// mainWindow.webContents.openDevTools()
}

Expand Down
15 changes: 14 additions & 1 deletion src/renderer/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<Input icon="ios-search" placeholder="在此页面搜索..." style="width: 100%" @on-change="searchUpdate" @on-focus="activeSearch" @on-blur="deactiveSearch"></Input>
<Menu :theme="app_config.theme || 'light'" mode="vertical" @on-select="menuNavi" :active-name="activeName || 'index'">
<MenuItem name="index" ><Icon type="ios-home-outline"></Icon>首页</MenuItem>
<MenuItem name="detail" ><Icon type="ionic"></Icon>电影详情</MenuItem>
<MenuItem name="settings"><Icon type="ios-toggle-outline"></Icon>设置</MenuItem>
</Menu>
</Sider>
Expand Down Expand Up @@ -35,7 +36,7 @@ export default {
},
methods: {
menuNavi(item) {
this.$router.push("/" + item);
this.$router.push(`/${item}`);
},
searchUpdate(e) {
this.setSearchContent(e.target.value);
Expand All @@ -47,6 +48,11 @@ export default {
"setSearchContent"
])
},
watch: {
$route(r) {
this.$set(this, "activeName", r.path.slice(1));
}
},
mounted() {
this.$set(this, "activeName", this.$route.path.slice(1));
},
Expand All @@ -64,13 +70,20 @@ export default {
overflow: hidden;
background: #fff;
height: calc(100vh - 69px);
cursor: default;
}
.root-content {
padding: 12px;
margin-left: 240px;
height: calc(100vh - 69px);
overflow: auto;
cursor: default;
}
h1, h2, h3, h4, h5, p, span, li {
user-select: none;
cursor: inherit;
}
</style>

Loading

0 comments on commit 96c3254

Please sign in to comment.