-
Notifications
You must be signed in to change notification settings - Fork 129
Version 2, ridding of reliance on web-service #6
Conversation
…e to download and convert right on the machine!
Big changes! No longer rely on an hosted webservice, we user ytdl-cor…
…ation so download and conversion are separated progress bars, set path for downloaded file to platform default downloads folder.
…ation so download and conversion are separated progress bars, set path for downloaded file to platform default downloads folder with display for user.
UpdateAdded:
Currently working on:
Needs doing that I can not accomplish:
|
UpdateAdded:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems much more complicated than what we were doing previously... could you explain the advantages of doing this? Specifically getting and mp4 and then converting it to mp3 versus using yt-mp3.
public/scss/global.scss
Outdated
@@ -93,3 +95,11 @@ body { | |||
cursor: pointer; | |||
} | |||
} | |||
|
|||
.outputFolderDisplay { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer to use BEM naming, otherwise use hypen-case versus camelCase.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure I'll make the adjustment
app/containers/app.container.js
Outdated
return <ProgressBar progress={this.state.progress} messageText={this.state.progressMessage}/>; | ||
return ( | ||
<div> | ||
<div className="outputFolderDisplay"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This appears to be the same code in both the if and else block. Maybe we can make a new React component for this code? Something like OutputFolder
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I was thinking about that too, still fiddling with react but I'll get it there
app/containers/app.container.js
Outdated
<div> | ||
<div className="outputFolderDisplay"> | ||
<a href='#' onClick={this.changeOutputFolder}>Change</a> | ||
<span> Current output folder: </span>{this.state.userDownloadsFolder} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make more sense to use CSS padding versus
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this is more just for now working on fixing this
app/containers/app.container.js
Outdated
return ( | ||
<div> | ||
<div className="outputFolderDisplay"> | ||
<a href='#' onClick={this.changeOutputFolder}>Change</a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you even need to put #
if there's not actually a link? I'm not sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do, but I'm not sure either
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the answer is no, but without it there is no "link" style to the "a" tag so I'll just remove the href and add css styling
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I quite like the css I put on it better than the default look of a html link and no need for class just style the a tag inside of containing element
app/containers/app.container.js
Outdated
let fileSelector = remote.dialog.showOpenDialog({properties: ['openDirectory'], title: 'Select folder to store files.'}); | ||
|
||
// If a folder was selected and not just closed, set the localStorage value to that path and adjust the state. | ||
if(fileSelector) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be a space between if and the ( e.g.
if (fileSelector)
app/containers/app.container.js
Outdated
progress: Math.floor(progress) | ||
}); | ||
changeOutputFolder() { | ||
// Create an electron open dialog for selecting folders, this will take into account platform |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Prefer to end comments that read as sentences with a period.
app/containers/app.container.js
Outdated
this.setState({progressMessage: 'Converting...', progress: 0}); | ||
|
||
return new Promise((resolve, reject) => { | ||
// reset the rate limiting trigger just encase. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Prefer to start inline comments with a capital letter.
The main benefit of using this over yt-mp3 is that we were bound to that service, this limits you in a few significant ways.
As for why we download an mp4 then convert it to mp3: this is more of a limitation workaround, youtube videos provide audio in mp4 format, we could download this and leave it there, and most modern players and software will be able to read it, but we convert to mp3 to ensure the greatest compatibility across players and platforms. |
Well, if it’s one line of HTML to get the styling versus a CSS class, then we should just do that. I was just curious.
…On Dec 7, 2017, 12:52 PM -0600, Mike S ***@***.***>, wrote:
@IT-MikeS commented on this pull request.
In app/containers/app.container.js:
> }
}
render() {
if (this.state.showProgressBar) {
- return <ProgressBar progress={this.state.progress} messageText={this.state.progressMessage}/>;
+ return (
+ <div>
+ <div className="outputFolderDisplay">
+ <a href='#' onClick={this.changeOutputFolder}>Change</a>
So the answer is now but without it there is no "link" style to the "a" tag so I'll just remove the href and add css styling
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was able to pull things down and test them out. Everything appeared to work as excepted. I like having the two different loading bars for downloading and converting, good idea.
I think instead of saying Conversion successful! Resetting in 5 seconds
, we can just say Conversion successful!
and reset after 1 second.
I'm sorry I didn't articulate this more clearly earlier, but I guess what I had in mind for the folder selection was to have it hidden in a menu. That way it wasn't modifying the UI at all. So in the menu bar there could be a "Preferences" option and underneath that would be a "Download Folder" option. Clicking that would pop the modal asking for the location and then continue to save it to local storage like such.
That would prevent us from having the text at the bottom of the application. I want to keep the UI very simple. I think it's okay that it doesn't show which folder it's downloading to.
app/containers/app.container.js
Outdated
@@ -4,6 +4,7 @@ import ProgressBar from '../components/ProgressBar'; | |||
const ytdl = window.require('ytdl-core'); | |||
const fs = window.require('fs-extra'); | |||
import * as path from 'path'; | |||
import OutputPath from "../components/OutputPath"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these imports be ordered? https://eslint.org/docs/rules/sort-imports
No worries, now hearing it, I like your idea for the output folder settings better. As for the conversion successful message your modification makes sense, I'll make both these changes as soon as I can and the sort order changes too |
…u item, and app now resets after 1 second after successful download and conversion.
I made all the modifications in your last comment and I think it looks and feels very good, great suggestions! |
app/containers/app.container.js
Outdated
|
||
// If a folder was selected and not just closed, set the localStorage value to that path and adjust the state. | ||
if (fileSelector) { | ||
let pathToStore = fileSelector[0]; | ||
localStorage.setItem('userSelectedFolder', pathToStore); | ||
this.setState({userDownloadsFolder: pathToStore}); | ||
console.log(`New current path ${localStorage.getItem('userSelectedFolder')}`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably isn't needed anymore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah just forgot to take the log out lol
Do you happen to know what bitrate the mp3s get converted to? Anyways, just tested everything and I totally agree. The menu option is awesome! I tried downloading short, medium, and long length videos. They all worked really well! Super excited that this now support videos that are 1 hour long. Maybe I'll test it with something that's like a day long haha. Nice work on this! 🎉 |
For the answer to the bitrate: its a value we can set in the ffmpeg lib, right now its at 160 (cd quality) As for the packaging issue, its the path to the icon, pushing a update that should resolve this. |
That should resolve the issue you were having |
Test building on windows, and tested with 24 hour video all is working well here |
Looks good to me! This should allow the user to easily change bitrates from a menu option in the future as well, which is nice 🎉 |
That's what I thought too, was going to work on download queue and better preferences menu, what do you think? |
That could be pretty neat! One thing I had thought about doing was utilizing Electron DL for something similar. Check it out: https://github.com/sindresorhus/electron-dl
…On Dec 12, 2017, 11:47 AM -0600, Mike S ***@***.***>, wrote:
That's what I thought too, was going to work on download queue and better preferences menu, what do you think?
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Okay i'll work on it, as for electron-dl, I like the idea but I think we'll need to modify it a bit to make it work with youtube videos |
Putting all changes from v2 branch into new master branch pull request.
Done:
Needs doing:
downloads
folder as default store for converted files.