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

Keep the same naming scheme #7

Open
JuniorJPDJ opened this issue Sep 12, 2020 · 1 comment
Open

Keep the same naming scheme #7

JuniorJPDJ opened this issue Sep 12, 2020 · 1 comment

Comments

@JuniorJPDJ
Copy link
Contributor

JuniorJPDJ commented Sep 12, 2020

Hi!
I'm trying to automate detection of new files posted on group I mounted.
The problem is your filenames are not consistent.

def message_doc_filename_format(msg: Message, doc: TgmountDocument):
attr_file_name = doc.atrributes.get('file_name')
if attr_file_name:
return ("%s %s" % (msg.id, attr_file_name)).encode()
else:
return ("msg_%s_doc" % msg.id).encode()

Could you please always prepend your names with ID, not make special case when name starts with msg and ID is somewhere inside? It will also fix sorting of files.

@JuniorJPDJ
Copy link
Contributor Author

JuniorJPDJ commented Sep 12, 2020

Guessing file extensions from mimetype provided by telegram when name is not known would be cool too ;)

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

1 participant