Skip to content
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

Incremental import of user settings #4672

Closed
5 tasks done
8ullyMaguire opened this issue Apr 27, 2024 · 3 comments
Closed
5 tasks done

Incremental import of user settings #4672

8ullyMaguire opened this issue Apr 27, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@8ullyMaguire
Copy link

8ullyMaguire commented Apr 27, 2024

Requirements

  • Is this a feature request? For questions or discussions use https://lemmy.ml/c/lemmy_support
  • Did you check to see if this issue already exists?
  • Is this only a feature request? Do not put multiple feature requests in one issue.
  • Is this a backend issue? Use the lemmy-ui repo for UI / frontend issues.
  • Do you agree to follow the rules in our Code of Conduct?

Is your proposal related to a problem?

Importing settings overwrites my existing settings. For example if I have some saved posts in an account and some others in another they get overwritten.

Describe the solution you'd like.

I want to merge settings for example have all saved posts or followed communities from both accounts in the one I'm importing into, without overwriting the existing data.

Describe alternatives you've considered.

I haven't considered any.

Additional context

No response

@8ullyMaguire 8ullyMaguire added the enhancement New feature or request label Apr 27, 2024
@Nutomic
Copy link
Member

Nutomic commented Apr 29, 2024

The import doesnt remove any existing saved posts, it only adds new ones. Same for followed communities just above. Did you test this properly?

@8ullyMaguire
Copy link
Author

I guess I didn't, my bad.

@Die4Ever
Copy link

Die4Ever commented May 5, 2024

seems like you can't import just a list of communities though

I was looking at this post https://feddit.uk/post/11434169

decided to build a little Javascript:

var links = document.querySelectorAll('#postContent a');
var coms = [];
links.forEach((i) => {
	var m = i.text.match(/!(.+)@(.+)/);
	if(m) {
		var c = 'https://' + m[2] + '/c/' + m[1];
		if(!coms.includes(c)) {
			coms.push(c);
		}
	}
});

var json = JSON.stringify( { "followed_communities": coms }, null, 2 );
console.log(json);

got this JSON:

{
  "followed_communities": [
    "https://lemmy.world/c/star_wars",
    "https://lemmy.world/c/starwars",
    "https://lemmy.ml/c/starwars",
    "https://lemmygrad.ml/c/starwars",
    "https://kbin.social/c/Starwars",
    "https://lemmy.dbzer0.com/c/starwars",
    "https://latte.isnot.coffee/c/starwars",
    "https://lemmy.world/c/starwarstelevision",
    "https://lemmy.world/c/starwarsfigures",
    "https://lemmy.world/c/starwarscollecting",
    "https://lemm.ee/c/legostarwars",
    "https://lemmy.ml/c/starwarseu",
    "https://sh.itjust.works/c/thehighrepublic",
    "https://lemmy.world/c/mawinstallation",
    "https://chirp.social/c/starwarscantina",
    "https://lemmy.world/c/starwarsmemes",
    "https://lemmy.ml/c/starwarsmemes",
    "https://lemmy.ml/c/otmemes",
    "https://lemmy.ml/c/prequelmemes",
    "https://lemmy.world/c/starwarsdadjokes",
    "https://lemmy.world/c/starwarsspeculation",
    "https://lemmy.world/c/themandalorian",
    "https://lemmy.world/c/themandaloriantv",
    "https://lemmy.world/c/starwarswhatif",
    "https://lemmy.world/c/swgalaxyofheroes",
    "https://lemmy.world/c/swgoh",
    "https://lemmy.world/c/swlegion",
    "https://lemmy.world/c/swrpg",
    "https://lemmy.world/c/swtor",
    "https://lemmy.world/c/starwarsarmada",
    "https://lemmy.ml/c/sw_unlimited",
    "https://lemmy.world/c/starwarsempireatwar",
    "https://lemmynsfw.com/c/starwarsnsfw"
  ]
}

and I got this error when trying to import:

{"error":"unknown","message":"There are no changes to save. This query cannot be built"}

@Nutomic Nutomic reopened this May 6, 2024
Nutomic added a commit that referenced this issue May 15, 2024
* Allow importing partial backup (fixes #4672)

* Fetch blocked objects if not known locally (fixes #4669)

* extract helper fn

* add comment

* cleanup

* remove test

* fmt

* remove .ok()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants