sanjacob / BlackboardSync

Download your Blackboard Learn content automatically
https://bbsync.app
GNU General Public License v2.0
34 stars 11 forks source link

Path naming fix #315

Open jrh03 opened 3 months ago

jrh03 commented 3 months ago

The previous body processing issue was simply to do with the config file (I figured after an hour or two). After deleting it everything began to redownload as expected.

The only other issue I had left was that some files stored in the ultraDocumentBody had them stored under an extra, unnecessary directory titled "ultraDocumentBody". These changes seem to fix that. This may not be the optimal implementation, however it seems simple and works for me.

Line 56, the handling of the ignoring in the write content method, may also not need the is_ultra flag, however after checking out the directory it seems to work well with it there, hence I haven't removed it.

jrh03 commented 3 months ago

314

Sorry, I haven't submitted a PR before. Also, the first commit that you may see in this PR was completely unnecessary as my issue was due to the config file.

sanjacob commented 2 months ago

Thanks for the PR. I understand that it might be confusing to have a directory named "ultraDocumentBody" instead of having the files in the parent directory.

However, there are two concerns I have.

  1. Name collision: what happens if within the parent directory there is already a file with that title. At least with api-only files titles are probably not duplicated. But I'm not sure the webdav body has that constraint.
  2. Is this title an established convention? How sure can we be that this title isn't different for other universities or versions of blackboard learn?

If these two are not an issue anymore then rather than manually checking if the content is ultra_body in the content base class, it's better to change this in the create_dir property of the content handler classes. I'm pretty sure right now I have set it as a classmethod, but this could easily depend on the content itself for Document. Thus, in the Document class, ultraDocumentBody content will not create a directory and will pass the same path it got passed to its content body links.