New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish by channel_id #1481

Merged
merged 1 commit into from May 25, 2018

Conversation

Projects
None yet
4 participants
@daovist
Collaborator

daovist commented May 16, 2018

Issue #1433

Add channelId to PublishState and use it to replace channel in PublishParams. Store both in redux while editing but always use channel_id to publish.

Adds myChannels: selectMyChannelClaims(state) to PublishForm and uses it to get a channel's id from its name when saving form data.

@tzarebczan check this out. I am able to create a new channel and publish seconds later

lbry fast publish

@seanyesmunt

It looks like you still need to change src/renderer/redux/actions/publish.js to look for channelId instead of channelName The file is being published without a channel currently. It just looks at the redux state on success to get the data for the modal.

@lbry-bot lbry-bot assigned seanyesmunt and unassigned seanyesmunt May 16, 2018

@seanyesmunt seanyesmunt assigned daovist and unassigned seanyesmunt May 16, 2018

@daovist

This comment has been minimized.

Show comment
Hide comment
@daovist

daovist May 16, 2018

Collaborator

I can't believe I missed that, it's the most important part.

I have made what should be the necessary changes to /redux/actions/publish.js and have published to new channels and anonymously. Now they stick around in My LBRY >> Publishes like they should.

When I go to the Publish page, I don't see channels I've created prior, my only options are anonymous and new channel, which seems wrong.

Collaborator

daovist commented May 16, 2018

I can't believe I missed that, it's the most important part.

I have made what should be the necessary changes to /redux/actions/publish.js and have published to new channels and anonymously. Now they stick around in My LBRY >> Publishes like they should.

When I go to the Publish page, I don't see channels I've created prior, my only options are anonymous and new channel, which seems wrong.

@tzarebczan

This comment has been minimized.

Show comment
Hide comment
@tzarebczan

tzarebczan May 16, 2018

Member

@daovist - nice work! lbryio/lbry-redux#26 should fix the channel selection issue. I'll test this out once that's merged into redux

Member

tzarebczan commented May 16, 2018

@daovist - nice work! lbryio/lbry-redux#26 should fix the channel selection issue. I'll test this out once that's merged into redux

@seanyesmunt

One small thing

@tzarebczan

This comment has been minimized.

Show comment
Hide comment
@tzarebczan

tzarebczan May 16, 2018

Member

@daovist Try editing a claim that has a channel, I get this: https://www.screencast.com/t/ubdCz0mx . It should say something like: "You are currently editing this claim". Not sure if this was a new bug introduced here, or if existed before.

Member

tzarebczan commented May 16, 2018

@daovist Try editing a claim that has a channel, I get this: https://www.screencast.com/t/ubdCz0mx . It should say something like: "You are currently editing this claim". Not sure if this was a new bug introduced here, or if existed before.

@daovist

This comment has been minimized.

Show comment
Hide comment
@daovist

daovist May 17, 2018

Collaborator

@tzarebczan interesting... This was already an issue so I will leave it out of this PR. But here is what I came across looking into this. uri and editingURI aren't going to match so even when you click edit you get that same message. I used normalizeURI and some logic to fix this so it says its an edit properly, but then if you're working on a new publish with the same name and channel it will give that same message. We need a better way to know when a user is in edit mode. Now, if a user clicks edit and leaves before re-publishing, editingURI won't be reset unless they click reset form.

The editingURI property is defined in the DO_PREPARE_EDIT reducer:

` [ACTIONS.DO_PREPARE_EDIT]: (state: PublishState, action) => {
const { ...publishData } = action.data;
const { channel, name } = publishData;

  const uri = buildURI({
    channelName: channel,
    contentName: name,
  });

  return {
    ...defaultState,
    editingURI: uri,
    ...publishData,
  };

`

The message displayed comes from this condition:

if (uri === editingURI)

Collaborator

daovist commented May 17, 2018

@tzarebczan interesting... This was already an issue so I will leave it out of this PR. But here is what I came across looking into this. uri and editingURI aren't going to match so even when you click edit you get that same message. I used normalizeURI and some logic to fix this so it says its an edit properly, but then if you're working on a new publish with the same name and channel it will give that same message. We need a better way to know when a user is in edit mode. Now, if a user clicks edit and leaves before re-publishing, editingURI won't be reset unless they click reset form.

The editingURI property is defined in the DO_PREPARE_EDIT reducer:

` [ACTIONS.DO_PREPARE_EDIT]: (state: PublishState, action) => {
const { ...publishData } = action.data;
const { channel, name } = publishData;

  const uri = buildURI({
    channelName: channel,
    contentName: name,
  });

  return {
    ...defaultState,
    editingURI: uri,
    ...publishData,
  };

`

The message displayed comes from this condition:

if (uri === editingURI)

@seanyesmunt

This comment has been minimized.

Show comment
Hide comment
@seanyesmunt

seanyesmunt May 17, 2018

Member

Looks like this was already a bug. I thought I fixed it but I guess not.

Member

seanyesmunt commented May 17, 2018

Looks like this was already a bug. I thought I fixed it but I guess not.

@seanyesmunt

This comment has been minimized.

Show comment
Hide comment
@seanyesmunt

seanyesmunt May 17, 2018

Member

Looks like channel isn't being correctly used to create uri in the publish reducer.

Member

seanyesmunt commented May 17, 2018

Looks like channel isn't being correctly used to create uri in the publish reducer.

@skhameneh

One minor suggestion

@lbry-bot lbry-bot assigned seanyesmunt and unassigned seanyesmunt May 24, 2018

@seanyesmunt seanyesmunt merged commit ea4c7d9 into master May 25, 2018

0 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build failed
Details
continuous-integration/travis-ci/push The Travis CI build failed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment