9001 / 9001/copyparty

Allow multiple entries for flags taking a regex argument(`unlist`, `no-idx`, `srch-excl`, etc.)

Aberta
#293 0 comentários 1 reação 1 responsável Reivindicada por @9001 Ver no GitHub
enhancement
Linguagem predominante
Python
Estrelas
46.7k
Forks
1.9k
Merge médio
9d 2h
PRs com merge (30d)
4

Descrição

While configuring Copyparty, I came across a gap in functionality which would make the software even more amazing. In my various folders I have mapped, there are many different kinds of files which I do not want to show up in the browser at all(not just hidden from search results), leading me to the `unlist` flag. This flag(as well as others such as `no-idx`, and `srch-excl`) takes a regex argument, which is then used to remove matching files from the file listing and index. Great!

However, in my use case I have a certain set of excludes I would like to globally ignore, and then additional sets for specific volumes as well. I noticed that only the most recent instance of the flag is used, meaning the globally ignored files I defined in the `[global]` section via `unlist: (eaDir|\.nfo$)` are totally ignored when I also specify `unlist: \.lrc$` within the `[flags]` section of a specified volume.

My proposal is as follows:
1. Respect both the `unlist` flag specified in the `[global]` section as well as the volume flag specified in the volume's config section
2. Support multiple instances of the `unlist` flag within the global config as well as the volume flags config. If supporting multiple instances of this flag is not possible due to the way config parsing works, then come up with another way to specify a list of regex strings to ignore.

Currently there is no good way to specify multiple ignore patterns, so if you want to exclude all `.nfo` files, all `.lrc` files, as well as any files containing the term `eaDir`, you must build a single regex encompassing all of these constraints. While that isn't very difficult when you only have a few exclude rules, it gets significantly more complicated as you add more exclusion rules to this.

Ideally we could specify multiple rules for `unlist`(but this really applies to all regex rules) something like so:
```
[global]
...
unlist: \.nfo$
unlist: eaDir

[/music]
...
[flags]
unlist: \.lrc$
unlist: cover.jpg
```

Or as an array-like argument
```
[global]
...
unlist: [ "\.nfo$", "eaDir" ]

[/music]
...
[flags]
unlist: [ "\.lrc$", "cover.jpg" ]
```

The above would then globally exclude all `*.nfo` files and any files containing the term `eaDir`, while the `/music` volume would exclude the aforementioned files specified in the `[global]` section _as well as_ all `*.lrc` files and any file named `cover.jpg`.

Guia de contribuição

Abrir o guia de contribuição

Direção de pesquisa

A issue trata do parsing de configuração para flags como `unlist`, `no-idx`, `srch-excl`. Examine a lógica de parsing de configuração na base de código, provavelmente em um módulo que lida com argumentos de linha de comando ou arquivos de configuração. Entenda como os argumentos regex são processados e armazenados atualmente. O objetivo é modificar o parsing para aceitar várias entradas por flag, seja como flags repetidas ou como um array. Verifique os testes existentes de parsing de configuração para ver como adicionar a nova funcionalidade e garantir a compatibilidade retroativa.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
python
Domínio
backend, cli
Tipo de issue
Funcionalidade
Dificuldade
3/5
Tempo estimado
1-2 dias
Status de atividade
Estagnada
Clareza
Claramente especificada
Facilidade para iniciantes
55/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.