mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-30 20:06:22 -05:00
Moving non-video functions to wrolpi.common. Handling Channel/Downlaod relationship in Channel.update.
Removing default download freqeuncy so channels will not be downloaded without a url and frequency. Adding channel unique url constraint. Handling when a Channel's directory may still be relative in DB. Adding TODOs to remove old favorites. Removing outdated favorites from config after favorites have been created. Testing that old-style favorited videos in the config are imported. Removing channels_by_link. Using list to store channels in config. Moving channel import function into lib. Supporting old channel import with links. Bumping version for channel.link removal. Removing all reference to Channel.link in app and api. Adding relative property to MediaPathType. Testing that a channel can be downloaded after it has a frequency added. All tests pass. Video and Channel tests pass without channel.link. Removing channel.link usage in channel api. Changing video Statistics page to About.
This commit is contained in:
parent
79efaa22b0
commit
aa203cc102
36 changed files with 1229 additions and 1308 deletions
|
|
@ -154,8 +154,8 @@ class ChannelPage extends APIForm {
|
|||
|
||||
async componentDidMount() {
|
||||
if (!this.props.create) {
|
||||
let channel_link = this.props.match.params.channel_link;
|
||||
let channel = await getChannel(channel_link);
|
||||
let channel_id = this.props.match.params.channel_id;
|
||||
let channel = await getChannel(channel_id);
|
||||
let statistics = channel.statistics;
|
||||
if (statistics) {
|
||||
this.setState({statistics: statistics || null});
|
||||
|
|
@ -173,7 +173,7 @@ class ChannelPage extends APIForm {
|
|||
|
||||
handleConfirm = async () => {
|
||||
this.setState({deleteOpen: false});
|
||||
let response = await deleteChannel(this.props.match.params.channel_link);
|
||||
let response = await deleteChannel(this.props.match.params.channel_id);
|
||||
if (response.status === 204) {
|
||||
this.props.history.push({
|
||||
pathname: '/videos/channel'
|
||||
|
|
@ -194,7 +194,7 @@ class ChannelPage extends APIForm {
|
|||
if (this.props.create) {
|
||||
response = await createChannel(inputs);
|
||||
} else {
|
||||
response = await updateChannel(this.props.match.params.channel_link, inputs);
|
||||
response = await updateChannel(this.props.match.params.channel_id, inputs);
|
||||
}
|
||||
|
||||
} finally {
|
||||
|
|
@ -215,7 +215,7 @@ class ChannelPage extends APIForm {
|
|||
this.setSuccess(
|
||||
'Channel created',
|
||||
<span>
|
||||
Your channel was created. View it <Link to={`/videos/channel/${channel.link}/edit`}>here</Link>
|
||||
Your channel was created. View it <Link to={`/videos/channel/${channel.id}/edit`}>here</Link>
|
||||
</span>
|
||||
);
|
||||
} else {
|
||||
|
|
@ -262,12 +262,12 @@ class ChannelPage extends APIForm {
|
|||
|
||||
downloadChannel = async (e) => {
|
||||
e.preventDefault();
|
||||
return await downloadChannel(this.props.match.params.channel_link);
|
||||
return await downloadChannel(this.props.match.params.channel_id);
|
||||
}
|
||||
|
||||
refreshChannel = async (e) => {
|
||||
e.preventDefault();
|
||||
return await refreshChannel(this.props.match.params.channel_link);
|
||||
return await refreshChannel(this.props.match.params.channel_id);
|
||||
}
|
||||
|
||||
handleDeleteButton = (e) => {
|
||||
|
|
@ -470,8 +470,8 @@ export function NewChannel(props) {
|
|||
class ChannelRow extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.editTo = `/videos/channel/${props.channel.link}/edit`;
|
||||
this.videosTo = `/videos/channel/${props.channel.link}/video`;
|
||||
this.editTo = `/videos/channel/${props.channel.id}/edit`;
|
||||
this.videosTo = `/videos/channel/${props.channel.id}/video`;
|
||||
}
|
||||
|
||||
render() {
|
||||
|
|
@ -646,7 +646,7 @@ export class Channels extends React.Component {
|
|||
<Table striped basic size='large'>
|
||||
{tableHeader}
|
||||
<Table.Body>
|
||||
{this.state.results.map((channel) => <ChannelRow key={channel.link}
|
||||
{this.state.results.map((channel) => <ChannelRow key={channel.id}
|
||||
channel={channel}/>)}
|
||||
</Table.Body>
|
||||
</Table>
|
||||
|
|
@ -655,7 +655,7 @@ export class Channels extends React.Component {
|
|||
<Table striped basic unstackable size='small'>
|
||||
<Table.Body>
|
||||
{this.state.results.map((channel) =>
|
||||
<MobileChannelRow key={channel.link} channel={channel}/>)}
|
||||
<MobileChannelRow key={channel.id} channel={channel}/>)}
|
||||
</Table.Body>
|
||||
</Table>
|
||||
</Responsive>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue