Anki-Android icon indicating copy to clipboard operation
Anki-Android copied to clipboard

Clarify which folders are expected to be profile folder

Open Arthur-Milchior opened this issue 2 years ago • 15 comments

I would love for a little bit of consistency in our codebase around variables that represents the profile directory.

For the context, the "profile directory" is called AnkiDroid right now, and is in the top level of the file system. This will change in a few months hopefully, the day where we'll allow for multiple profiles on the same device.

Many functions takes as input the profile directory. But sometime they take as input the back-up directory or the media directory. It would be great if:

  • the documentation of each function taking a directory as input indicates which directory is expected
  • the parameter name of the function indicates whether it's a profile, media or backup directory (and more importantly, be uniform, always use the same variable name, for the sake of search and simplicity)

In a separate PR (because that require more discussion): maybe introduce an type that represents those three kinds of directory, so that even the type system would allow to know which kind of directory we expect.

In my book, I'd love ProfileDirectory, for example, to extend Directory, or maybe simply File, and just have two extra methods getMediaDirectory and getBackupDirectory

Originally posted by @Arthur-Milchior in https://github.com/ankidroid/Anki-Android/pull/10496#pullrequestreview-908056340

Arthur-Milchior avatar Mar 12 '22 21:03 Arthur-Milchior

@Arthur-Milchior can i work on this issue

Prince-kushwaha avatar Mar 13 '22 03:03 Prince-kushwaha

@Prince-kushwaha please do

Arthur-Milchior avatar Mar 13 '22 04:03 Arthur-Milchior

I just want to say, for historical context, I literally started working on AnkiDroid because I found it so useful that I wanted to use it for my child as well. And I needed multiple profiles. And AnkiDroid did not support them and I thought - I can add that!

Instead, I ended up fixing CardTemplateEditor crashes (that took almost 2 years?) and now I'm a maintainer, and I STILL HAVE NOT ADDED MULTIPLE PROFILES :rofl:

So anything that heads in that direction will receive my personal gratitude :bow:

mikehardy avatar Mar 14 '22 15:03 mikehardy

I guess no one's working on this issue currently, so may I work on it ? @Arthur-Milchior

rskbansal avatar Mar 16 '22 10:03 rskbansal

can i work on this @Arthur-Milchior ?

Jatin887 avatar Mar 23 '22 05:03 Jatin887

Oops, sorry, @rskbansal if you still want, go for it. Unless you are already working on something

Arthur-Milchior avatar Mar 25 '22 13:03 Arthur-Milchior

Any update on this issue?

thedroiddiv avatar May 21 '22 20:05 thedroiddiv

@Jatin887 are you still interested? If so, and if @rskbansal has not answered tuesday, you can. If you are not interested, or don't answer by thursday, @divyansh-dxn can.

Arthur-Milchior avatar May 22 '22 01:05 Arthur-Milchior

@Jatin887 are you still interested? If so, and if @rskbansal has not answered tuesday, you can. If you are not interested, or don't answer by thursday, @divyansh-dxn can.

I am interested

Jatin887 avatar May 22 '22 01:05 Jatin887

@Jatin887 are you still interested? If so, and if @rskbansal has not answered tuesday, you can. If you are not interested, or don't answer by thursday, @divyansh-dxn can.

Can I start working on this?

Jatin887 avatar May 25 '22 06:05 Jatin887

Please do @Jatin887. Thanks a lot for keeping interest in this.

Arthur-Milchior avatar May 25 '22 14:05 Arthur-Milchior

I would love for a little bit of consistency in our codebase around variables that represents the profile directory.

For the context, the "profile directory" is called AnkiDroid right now, and is in the top level of the file system. This will change in a few months hopefully, the day where we'll allow for multiple profiles on the same device.

Many functions takes as input the profile directory. But sometime they take as input the back-up directory or the media directory. It would be great if:

  • the documentation of each function taking a directory as input indicates which directory is expected
  • the parameter name of the function indicates whether it's a profile, media or backup directory (and more importantly, be uniform, always use the same variable name, for the sake of search and simplicity)

In a separate PR (because that require more discussion): maybe introduce an type that represents those three kinds of directory, so that even the type system would allow to know which kind of directory we expect.

In my book, I'd love ProfileDirectory, for example, to extend Directory, or maybe simply File, and just have two extra methods getMediaDirectory and getBackupDirectory

Originally posted by @Arthur-Milchior in #10496 (review)

can you please explain it more . I didn't get it completely

Jatin887 avatar May 28 '22 13:05 Jatin887

@Jatin887 do you have any specific question? I'd be glad to answer question. Maybe do the part you got, so that you'll get a first PR out of it while we wait to discuss this. If you're on discord, you can also ask here ,that may allow to have quicker discussion to clarify it, and then write down the conclusion here

Arthur-Milchior avatar May 28 '22 20:05 Arthur-Milchior

@Jatin887 are you still on this issue?

Arthur-Milchior avatar Jun 11 '22 18:06 Arthur-Milchior

Hello 👋, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically

github-actions[bot] avatar Aug 10 '22 20:08 github-actions[bot]

I'll take that as a no. If I get to a point when I've no review to done quickly, I guess I'll do it

Arthur-Milchior avatar Aug 12 '22 21:08 Arthur-Milchior

I'll work on this and won't ghost you for sure ;) just some doubts: 1) Do you just want to change the name of some variables for consistency in the codebase? 2)So do I have to manually edit the variable names in each file? 3)If so which files are those and how do I know it's a profile, media or backup directory?

sparkyniner avatar Aug 26 '22 07:08 sparkyniner

Hello 👋, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically

github-actions[bot] avatar Oct 25 '22 07:10 github-actions[bot]

keep open

thedroiddiv avatar Oct 25 '22 13:10 thedroiddiv

Hello 👋, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically

github-actions[bot] avatar Dec 24 '22 14:12 github-actions[bot]