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

Cards NOT created in Samsung Galaxy Tab 7 #138

Closed
r-ichi opened this issue Jan 1, 2023 · 36 comments
Closed

Cards NOT created in Samsung Galaxy Tab 7 #138

r-ichi opened this issue Jan 1, 2023 · 36 comments

Comments

@r-ichi
Copy link

r-ichi commented Jan 1, 2023

when trying to "create a card from context"
playing an MKV file,
loaded with external subtitles in SRT format

the card generator panel has the audio, the screenshot, the sentence and everything.

still, when pressing "create card" and receiving the message "card added to X-deck", such card simply does not get exported to the respective Anki deck.

device:
CPU architecture : ARMv8-A
Instruction Sets : arm64-v8a
OS version : Tiramisu (13)
SDK : 33
Java VM : ART 2.1.0

Could it be something with the permissions of something Samsung-related?
(all possible permissions have been granted for both Anki and Jidoujisho in the "Apps" section of the device settings)

is there any way to fix it myself?

This project is amazing, probably the the best tool for self-learning out there.
It really makes being alive in this era worth it.

Cheers, lrorpilla.
You're awesome.

@arianneorpilla
Copy link
Owner

I reckon it's related to a permissions issue related to adding the image and audio file, which fails due to where those files are placed before being passed to AnkiDroid to be added to the media collection.

I had someone report something similar and my suspicion is probably correct if you try exporting a card without an audio and image and it happens to work.

@r-ichi
Copy link
Author

r-ichi commented Jan 1, 2023

damn, is that related to how the device is natively configured by the manufacturer? or is there a way to override that?

Thank you :)

@arianneorpilla
Copy link
Owner

This will require a new version, I will probably try to get my hands on a test device that has this issue.

@r-ichi
Copy link
Author

r-ichi commented Jan 3, 2023

small update to the issue after checking the suggestion,
no cards (regardless of the type/content/method of construction) get exported to Anki in this device
even without audio and no image.

@arianneorpilla
Copy link
Owner

What does your export profile look like? Could you take a screenshot? You can find yours by going to the main menu and selecting Export profiles and selecting Edit on your profile.

@r-ichi
Copy link
Author

r-ichi commented Jan 4, 2023

The profile seems to simply be the standard one.
The screenshot here:

Screenshot_20230104_014621

@arianneorpilla
Copy link
Owner

Hi, I will need to see profile being edited. Select the three dots option on the upper right and click on Edit and you should screenshot that screen instead.

@r-ichi
Copy link
Author

r-ichi commented Jan 4, 2023

All the fields have are on "Empty" ...
Could the solution be that simple? :/

@arianneorpilla
Copy link
Owner

Yeah, in some versions the fields are possibly not set so if you put something in there, you can probably export properly. I'm going to add a message that tells you that you can't export with a completely empty profile at some point. Let me know if it works after you've set the fields.

@r-ichi
Copy link
Author

r-ichi commented Jan 4, 2023

it was finally possible to export a card from a video source, although the image is lost and does not show in the anki deck. But he audio works.

Screenshot_20230104_020919

Screenshot_20230104_021051_AnkiDroid

@arianneorpilla
Copy link
Owner

arianneorpilla commented Jan 4, 2023

Yeah, looks like the issue here is twofold - the empty export profile and a permissions issue on your Samsung device that prevents proper image and audio export that I will have to investigate how to fix.

@r-ichi
Copy link
Author

r-ichi commented Jan 4, 2023

This is still better than having no output at all, and a new version that handles this issue will probably take a good amount of your time.
In the meantime I'll try to experiment with some profile configs and see if it's possible to get the images working and report the results here if there's any success.

Thank you so much for your support and for creating this great app.

@arianneorpilla
Copy link
Owner

arianneorpilla commented Jan 4, 2023

I have a potential fix for this issue but it will require testing on your device. Can you please try this version? You might need to uninstall to try and install the version. Please note that the version contains a different font to also fix #139.

@arianneorpilla
Copy link
Owner

I've updated the version above, you can download it from the same link but if you happened to download it prior, I've fixed an issue which causes a white screen in the player.

@r-ichi
Copy link
Author

r-ichi commented Jan 5, 2023

Uninstalled and rebooted the device,
Tried to mine a card from an mkv source as described above (with the default profile and no changes to it, do all the fields are on "empty ") and the export did not work.

Tried creating a profile as follows and eventually, the export works but the image and audio are lost in the process.
Here are the associated screenshots:

Screenshot_20230104_205232
Screenshot_20230104_204602
Screenshot_20230104_204611_AnkiDroid

@arianneorpilla
Copy link
Owner

Looks like this issue is reported by users who have Motorola and Samsung devices so far, and I'm sure others are affected too. It's almost probably an issue related to scoped storage permissions. I will investigate further but the biggest difficulty I have is the lack of a device to reproduce and test with (I have a Pixel device).

@r-ichi
Copy link
Author

r-ichi commented Jan 5, 2023

Curiously, in my MotoG8, Chiisa is slow but works and exports from video contexts are possible. Idk about Yunna, though. If there's any way to help you with testing or somehow making this Samsung device remotely available for you, count on me.

Unrelated comment,
what do you think about a dual subtitle option for the video player?
Cheers

@arianneorpilla
Copy link
Owner

arianneorpilla commented Jan 5, 2023

Could you please test Yuuna on your moto and see if you get the same behaviour, and Chisa on your Samsung? It would help me get an idea of what's going on and whether I can reuse Chisa code as a fallback.

Thanks for being eager to help me debug.

@arianneorpilla
Copy link
Owner

arianneorpilla commented Jan 5, 2023

On the topic of dual subtitles, while convenience is one thing, my motivation is to prevent certain pitfalls that a user might fall into by being very prescriptive about what they can do and can't do and minimising choice in some instances in favour of pushing the user to get used to things as is.

This is the reason I'm not motivated similarly to make certain words glow or offer any extra assistance beyond the pop-up dictionary -- I'd like users to get used to experiencing the language as a native would with nothing much extra, and get used to the fact that usually, this is really all you will have most of the time -- if you pick up a book or watch a video on YouTube, you should get used to things -- i.e. to ride a bike without training wheels, and in doing so have you hopefully get to a very high level that you wouldn't need this app at all.

Conversely, that's also the reason why I try to offer things like the ability to hide certain dictionaries, to motivate the user to try and get used to monolingual dictionaries.

In the case others feel otherwise and not see eye to eye with that philosophy, the app is open source and I wouldn't be against somebody making a fork or PR.

Of course, this is a very pedantic thing -- it's a very simple thing to add, there's no technical reason we can't have it, but I would rather work on other things I think might be useful and motivate the user to get used to the language without extra sprinkles. I know it not might be what you wanted, but I hope that answers your question.

@r-ichi
Copy link
Author

r-ichi commented Jan 5, 2023

The perspective of immersion makes absolute sense, unfortunately in the beginning stages it takes a long time to "intuitively" grasp what's going on and translations (e.g. subtitles on a known language) help a lot, but at the same time limit the learning process and might even make the learner reliant on them. It takes some time before you notice that is "better" not to have any translations at all.

There's something about this transition process where you go back and forth (translated_subs, jap_only_subs) and the app being intended mainly for monolingual purposes is probably the best course of action. I personally intend to use it for mining only things that I can't understand, or those that one day make sense, but the next day I have no idea what it meant... weird transition phenomenon.

I'll try Yuuna on the Moto, the performance sucks so it might take a while.

About Chiisa on the tablet, I can give it a try right now, BUT I do remember trying it before in the Samsung tab and failing to export too, but is there any specific version to try that experiment with?

@r-ichi
Copy link
Author

r-ichi commented Jan 5, 2023

MotoG8 Chiisa 1.1.2
adequately creates cards from a local video source with subtitles. [ card is properly found in Anki ]
When sourcing from youtube, it fails to generate/crop the audio (even before the export) [ card is found in Anki with no audio]

MotoG8 Yuuna 2.1.0
from local media: generates card template properly, but again fails to export it [ nowhere to be found in Anki ]
cannot export cards created from the reader either [ nowhere to be found in Anki ]

@arianneorpilla
Copy link
Owner

arianneorpilla commented Jan 5, 2023

@r-ichi, on your main device can you send me what the card looks like when you edit it from Anki (I need to see all fields) and can you also send your card template (in Anki?)

@arianneorpilla
Copy link
Owner

arianneorpilla commented Jan 5, 2023

I recommend editing your card type in Anki to

  • Rename your Audio field to Term Audio
  • Add a Sentence Audio field at the very last after the last field

This should bring your card type to be exactly the same as the new default card type added by the app (the default number of fields were changed post-2.0). Try changing the card type in Anki. Once you reinstall the app, you will notice that the Standard export profile no longer has empty fields by default.

It should be as such:
Screenshot_20230105-151102

@arianneorpilla
Copy link
Owner

Double-check that your Anki template for "jidoujisho Yuuna" is as such:

Front

<div id="word">{{Term}}</div><hr>

Back

<div id="word">{{Term}}</div><hr><p id="sentence">{{Sentence}}</p><br>{{#Term Audio}}[sound:{{Term Audio}}]{{/Term Audio}}{{#Sentence Audio}}<br>[sound:{{Sentence Audio}}]{{/Sentence Audio}}{{#Image}}<div class="image"><img src="{{Image}}"></div>{{/Image}}{{#Pitch Accent}}<br>{{Pitch Accent}}<br>{{/Pitch Accent}}<br><h2 id="word">{{furigana:Furigana}}</h2><br>{{#Meaning}}<p><small id="meaning">{{Meaning}}</p </small><br>{{/Meaning}}{{#Expanded Meaning}}<p><small id="meaning">{{Expanded Meaning}}</small></p>{{/Expanded Meaning}}<br>
{{#Collapsed Meaning}}<details><summary></summary>
<p><small id="meaning">{{Collapsed Meaning}}</small></p>
</details>{{/Collapsed Meaning}}

CSS

p {
    margin: 0px
}

h2 {
    margin: 0px
}

small {
    margin: 0px
}

.card {
  font-family: arial;
  font-size: 17px;
  text-align: center;
  color: black;
  background-color: white;
  white-space: pre-line;
}

#sentence {
    font-size: 30px
}

.context.night_mode {
    text-decoration: none;
    color: red;
}
.context {
    text-decoration: none;
    color: red;
}

.image img {
  position: static;
  height: auto;
  width: auto;
  max-height: 150px;
}
.pitch{
  border-top: solid red 2px;
  padding-top: 1px;
}

.pitch_end{
  border-color: red;
  border-right: solid red 2px;
  border-top: solid red 2px;  
  line-height: 1px;
  margin-right: 1px;
  padding-right: 1px;
  padding-top:1px;
}

@arianneorpilla
Copy link
Owner

arianneorpilla commented Jan 5, 2023

I know that's a lot, but I just want to make sure it's not a template issue before I investigate more.

The easiest way if you don't want to get around this is to delete your card type in Anki (you will lose all cards under jidoujisho Yuuna) and then installing the 2.2.0 fix I uploaded and seeing if that adds the new template and adds the card to AnkiDroid on export.

If you don't want to lose anything, we will have to just make sure that your card type and HTML/CSS templates are the same so we eliminate that as a possible issue.

I've double-checked that a fresh new AnkiDroid install with no custom card types displays the default card type with image and audio added by 2.2.0 on a OnePlus 6.

@r-ichi
Copy link
Author

r-ichi commented Jan 5, 2023

I'm not an expert on Anki, by any means, and know little about configuring the fields in Anki... or in Jidoujisho...
Sorry, I'm trying to do this to the best of my current capabilities.

I'm trying to use windows to access the Anki collection and create a new template ("Note Type")

image

When pasting the pieces of html code you provided, the results are:
-it is not possible to save the template due to a mismatch somewhere in the code

image

image

image

I tried manipulating some of the brackets of {{Term}} changing it to {Term}, but no success.

@arianneorpilla
Copy link
Owner

Given that you only have 3 notes under jidoujisho Yuuna, you can just delete the card type under AnkiDroid.

Then, you can try running 2.2.0 and have it re-add a new jidoujisho Yuuna default card type. That will be easier than everything I just said above.

@r-ichi
Copy link
Author

r-ichi commented Jan 6, 2023

It finally worked!

deleting all those notes and and letting Yuuna create the "jidoujisho Yuuna" profile automatically after the installation.
A new "exporting profile" had to be created for this, with all the fields set like you mentioned and the last option ( 'Wrap Image/Audio with Tags) set to 'off/deactivated'

Now cards created from videos are properly found in Anki
If there's any need for screenshots or more details of the process let me know.

by the way, is there a way to create a profile that generates reverse cards too?
a way to expand the audio length that's mined from a video by a few seconds? (a few seconds earlier and/or few seconds later)
and is there a way to get this 2.2.0 version for a MotoG8 ? unfortunately Yuuna 2.02 armeabi-v7a crashes in this device when trying to import dictionaries.

Thank you for all your patience.
Regads

@arianneorpilla
Copy link
Owner

Hi, @r-ichi, I've officially released 2.1 (downed the version as I realize there hasn't been an official one), could you please try and see if that imports better on your G8?

@r-ichi
Copy link
Author

r-ichi commented Jan 6, 2023

installing this version removed the 1.1.12 Chiisa armeabi version that was previously installed in the G8.
After rebooting, it was possible to finally import Sanseido Supa Daijirin ( filename: (4) 三省堂 スーパー大辞林.zip ) as a dictionary and Kenkyusha ( filename: (2) 研究社 新和英大辞典 第5版.zip ).

but for some reason when trying to import 広辞苑第六版 • 付属資料.zip , while not crashing, Yuuna sends an error message saying ' Import Error : Exception: Unable to get name '

importing all of those dictionaries in Chiisa was never an issue, it just took time but the search algorithm was slow.
Yuuna clearly is blazingly fast when looking up terms, you made an amazing improvement.

Hopefully the crashing message when trying to import 広辞苑第六版 • 付属資料.zip will give you some insight about how the app is behaving.

Cheers, man.

@arianneorpilla
Copy link
Owner

arianneorpilla commented Jan 9, 2023

@r-ichi, you can use the Audio Allowance option to adjust the allowance bi-directionally if you want just a bit more longer audio. As for reverse cards, you will need to make your own export profile. I'd be happy to hear what you think of the 2.2 performance gains.

I'm going to close this issue, but you are welcome to follow up and make a new one regarding that dictionary if I don't get around to testing it.

@r-ichi
Copy link
Author

r-ichi commented Jan 10, 2023

perfect!

one last thing, I found out that if the "sentence" field is left to 'empty', that causes cards not to be generated (under any condition it seems)

hopefully that detail will also help you on the continuous development of your project
cheers!

@arianneorpilla
Copy link
Owner

arianneorpilla commented Jan 10, 2023

Do you mean if the export profile is set to Empty? I can't replicate this issue, I've set my export profile to Empty and tried to export cards in the Creator with only Term set on them and they export just fine.

If you're willing to send some examples and screenshots dealing with this situation, I would be happy for you to report this as a new issue.

@r-ichi
Copy link
Author

r-ichi commented Jan 11, 2023

Sure. It might still be an issue of this specific type of device and not apply to other devices (not galaxy tab 7), but I'll try to replicate it and open an issue

@r-ichi
Copy link
Author

r-ichi commented Jan 11, 2023

Sure. It might still be a problem for this specific type of device (galaxy tab), but I can try to replicate it and open an issue for it with the videos/screenshots

how do you access the "audio allowance" option?

thanks!

@arianneorpilla
Copy link
Owner

Should be under the audio/subtitles menu (the button before the bottom-right button in the player

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants