MatteoGuadrini / mkpl

Make M3U format playlist from command line
https://matteoguadrini.github.io/mkpl
GNU General Public License v3.0
26 stars 2 forks source link

[QUESTION] Can we put many file types in the -include arg? #13

Closed masterofobzene closed 1 month ago

masterofobzene commented 1 month ago

Can we put many file types in the -include arg?

How does it work?

-i mkv;jpg

-i mkv jpg

-i mkv -i jpg

-i mkv,jpg
masterofobzene commented 1 month ago

hey there! I found that you missed mkv as one of the movie formats. I just added the picture formats I wanted to the mkpl.py like this:

VIDEO_FORMAT = {
    "mp4",
    "avi",
    "xvid",
    "divx",
    "mpeg",
    "mpg",
    "mov",
    "wmv",
    "flv",
    "vob",
    "asf",
    "m4v",
    "3gp",
    "f4a",
    "jpg",
    "jpeg",
    "bmp",
    "gif",
    "png",
    "mkv",
    "webp",
    "ts",
    "tiff",
}
MatteoGuadrini commented 1 month ago

Can we put many file types in the -include arg?

How does it work?

-i mkv;jpg

-i mkv jpg

-i mkv -i jpg

-i mkv,jpg

Isn't that already the case?

usage: mkpl [-h] [-v] [-V] [-d DIRECTORIES [DIRECTORIES ...]] [-e EXCLUDE_DIRS [EXCLUDE_DIRS ...]] [-i FORMAT [FORMAT ...]] ...

as the help says, you can type as many extensions as you want with spaces:

cd myfolder && mkpl playlist1 -i mkv mp4 avi etc .src *.src2

As for extensions, you proposed image-type extensions within video formats... I don't think that's correct. As for the mkv format, I will include it in the defaults in the next release.

masterofobzene commented 1 month ago

OK, tried it and worked like that; it seems I missed the files in my playlist in my last test (it only seemed to work with the last extension on the -i argument while ignoring the others.

I have brute-forced the script to accept the extensions I needed, seeing that the argument -i was 'not working with many extensions I needed'; I suppose that It was working and I didn't see the files being added to the already huge playlist I have.

I would humbly recommend changing the examples in the help from this:

[-i FORMAT [FORMAT ...]]

to this:

[-i FORMAT [EXTENSION EXTENSION ...]]

I would also recommend to change the -i arg to something more intuitive like -ext. It would look like:

[-ext EXTENSION [EXTENSION EXTENSION ...]]

But this is just for better understanding.

MatteoGuadrini commented 1 month ago

The word format is used in files to identify the compatible format. Especially in the audio/video field, we talk about formats and not extensions. I think it's best to leave it as it is.