Repository: paperless-ngx/paperless-ngx

Issue:
[BUG] Error while consume document from consume folder - CELERY
### Description

I have problem with Dev branch with Celery. When Paperless consume document from folder with CONSUMER_SUBDIRS_AS_TAGS=true, error is occure:  Object of type set is not JSON serializable

If I comment line 97 in src/documents/management/commands/document_consumer.py  
`# override_tag_ids=tag_ids if tag_ids else None,`
Paperless-ngx will consume document, but I don't have tags from folders :)




### Steps to reproduce

1. Try to consume document with CONSUMER_SUBDIRS_AS_TAGS=true

### Webserver logs

```bash
[2022-11-07 00:35:47,575] [INFO] [paperless.management.consumer] Adding /usr/src/paperless/consume/inbox/printer/list.txt to the task queue.
[2022-11-07 00:35:47,623] [ERROR] [paperless.handlers] Creating PaperlessTask failed: Object of type set is not JSON serializable
[2022-11-07 00:35:47,624] [ERROR] [paperless.management.consumer] Error while consuming document
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/kombu/serialization.py", line 39, in _reraise_errors
    yield
  File "/usr/local/lib/python3.9/site-packages/kombu/serialization.py", line 210, in dumps
    payload = encoder(data)
  File "/usr/local/lib/python3.9/site-packages/kombu/utils/json.py", line 68, in dumps
    return _dumps(s, cls=cls or _default_encoder,
  File "/usr/local/lib/python3.9/json/__init__.py", line 234, in dumps
    return cls(
  File "/usr/local/lib/python3.9/json/encoder.py", line 199, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/usr/local/lib/python3.9/json/encoder.py", line 257, in iterencode
    return _iterencode(o, 0)
  File "/usr/local/lib/python3.9/site-packages/kombu/utils/json.py", line 58, in default
    return super().default(o)
  File "/usr/local/lib/python3.9/json/encoder.py", line 179, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type set is not JSON serializable

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/src/paperless/src/documents/management/commands/document_consumer.py", line 95, in _consume
    consume_file.delay(
  File "/usr/local/lib/python3.9/site-packages/celery/app/task.py", line 425, in delay
    return self.apply_async(args, kwargs)
  File "/usr/local/lib/python3.9/site-packages/celery/app/task.py", line 575, in apply_async
    return app.send_task(
  File "/usr/local/lib/python3.9/site-packages/celery/app/base.py", line 788, in send_task
    amqp.send_task_message(P, name, message, **options)
  File "/usr/local/lib/python3.9/site-packages/celery/app/amqp.py", line 510, in send_task_message
    ret = producer.publish(
  File "/usr/local/lib/python3.9/site-packages/kombu/messaging.py", line 166, in publish
    body, content_type, content_encoding = self._prepare(
  File "/usr/local/lib/python3.9/site-packages/kombu/messaging.py", line 254, in _prepare
    body) = dumps(body, serializer=serializer)
  File "/usr/local/lib/python3.9/site-packages/kombu/serialization.py", line 210, in dumps
    payload = encoder(data)
  File "/usr/local/lib/python3.9/contextlib.py", line 137, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/usr/local/lib/python3.9/site-packages/kombu/serialization.py", line 43, in _reraise_errors
    reraise(wrapper, wrapper(exc), sys.exc_info()[2])
  File "/usr/local/lib/python3.9/site-packages/kombu/exceptions.py", line 21, in reraise
    raise value.with_traceback(tb)
  File "/usr/local/lib/python3.9/site-packages/kombu/serialization.py", line 39, in _reraise_errors
    yield
  File "/usr/local/lib/python3.9/site-packages/kombu/serialization.py", line 210, in dumps
    payload = encoder(data)
  File "/usr/local/lib/python3.9/site-packages/kombu/utils/json.py", line 68, in dumps
    return _dumps(s, cls=cls or _default_encoder,
  File "/usr/local/lib/python3.9/json/__init__.py", line 234, in dumps
    return cls(
  File "/usr/local/lib/python3.9/json/encoder.py", line 199, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/usr/local/lib/python3.9/json/encoder.py", line 257, in iterencode
    return _iterencode(o, 0)
  File "/usr/local/lib/python3.9/site-packages/kombu/utils/json.py", line 58, in default
    return super().default(o)
  File "/usr/local/lib/python3.9/json/encoder.py", line 179, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
kombu.exceptions.EncodeError: Object of type set is not JSON serializable
```


### Browser logs

_No response_

### Paperless-ngx version

dev

### Host OS

Ubuntu

### Installation method

Docker - official image

### Browser

_No response_

### Configuration changes

_No response_

### Other

_No response_


Discussion:
Should be simple enough once I can look at the code off my phone. Thanks for testing out the dev branch and finding this

Resolving patch:
diff --git a/src/documents/management/commands/document_consumer.py b/src/documents/management/commands/document_consumer.py
--- a/src/documents/management/commands/document_consumer.py
+++ b/src/documents/management/commands/document_consumer.py
@@ -94,7 +94,7 @@ def _consume(filepath):
         logger.info(f"Adding {filepath} to the task queue.")
         consume_file.delay(
             filepath,
-            override_tag_ids=tag_ids if tag_ids else None,
+            override_tag_ids=list(tag_ids) if tag_ids else None,
         )
     except Exception:
         # Catch all so that the consumer won't crash.


Test patch: