-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from fxsth/develop
Merge develop into master
- Loading branch information
Showing
29 changed files
with
475 additions
and
249 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
# pledo | ||
Plex downloader | ||
# pledo - Plex Downloader | ||
|
||
This is a simple downloader for movies and tv shows of accessible plex media servers. | ||
If you either want a copy of your friends media or your bandwidth cant just handle a stream - this can be your solution. | ||
Deploy on your media server as container and access by web frontend. | ||
|
||
Focused on proper functioning rather than good looking design. Features: | ||
- .Net backend + React frontend | ||
- .Net backend + React.js frontend | ||
- Log in by plex.tv, no need for typing in password into this app | ||
- Sync all media metadata of all accessible servers, backed by local db | ||
- Browse all media, select and download directly | ||
- docker support | ||
|
||
Use `docker pull ghcr.io/fxsth/pledo:master` to get the docker image of current master version. | ||
|
||
![Download screenshot](images/screenshot-downloads.png) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
import React, {Component} from 'react'; | ||
import {Badge, Button, Progress, Table} from "reactstrap"; | ||
|
||
export class Downloads extends Component { | ||
static displayName = Downloads.name; | ||
|
||
constructor(props) { | ||
super(props); | ||
this.state = {downloads: [], loading: true}; | ||
} | ||
|
||
componentDidMount() { | ||
this.populateData(); | ||
this.timerID = setInterval( | ||
() => this.populateData(), | ||
2000 | ||
); | ||
} | ||
|
||
componentWillUnmount() | ||
{ | ||
clearInterval(this.timerID); | ||
} | ||
|
||
renderDownloadTable(downloads) { | ||
return ( | ||
<Table> | ||
<thead> | ||
<tr> | ||
<th>Name</th> | ||
<th>Started at</th> | ||
<th>Status</th> | ||
<th>Cancel</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{downloads.map(download => | ||
<tr key={download.id}> | ||
<td>{download.name}</td> | ||
<td>{download.started!= null ? (new Date(download.started)).toLocaleString() : ""}</td> | ||
<td> | ||
{download.started != null ? | ||
download.progress < 1 ? | ||
download.finished == null ? | ||
(<Progress visible={true} value={download.progress * 100}> | ||
{Math.round(download.progress * 100)}% | ||
</Progress> | ||
) : <Badge color="danger" pill>Cancelled</Badge> : (<Badge color="success" pill>Finished</Badge>) : (<Badge color="info" pill>Pending</Badge>) | ||
} | ||
</td> | ||
<td> | ||
{(download.progress == null || download.progress<1) && download.finished == null ? | ||
<Button color="danger" outline size="sm" onClick={() => this.handleClick(download.mediaKey)}>Cancel</Button> | ||
: | ||
""} | ||
</td> | ||
</tr> | ||
)} | ||
</tbody> | ||
</Table> | ||
); | ||
} | ||
|
||
handleClick(key){ | ||
const settings = { | ||
method: 'DELETE' | ||
}; | ||
fetch('api/download/' + key, settings) | ||
.then(response => { | ||
if (response.status >= 200 && response.status < 300) { | ||
console.log("Download cancelled."); | ||
} else { | ||
alert('Could not cancel download due to an unknown error.'); | ||
} | ||
}) | ||
} | ||
|
||
render() { | ||
let contents = this.state.loading | ||
? <p><em>Loading...</em></p> | ||
: this.renderDownloadTable(this.state.downloads); | ||
|
||
return ( | ||
<div> | ||
<h1 id="tabelLabel">Downloads</h1> | ||
<p>Your download history:</p> | ||
{contents} | ||
</div> | ||
); | ||
} | ||
|
||
async populateData() { | ||
const response = await fetch('api/download'); | ||
const data = await response.json(); | ||
this.setState({downloads: data, loading: false}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.