I would factorize things a bit here:
```python
if metadata['title'] == filename:
    stripped_filename = filename.lstrip('0')
    tnlen = len(tracknumber)
    if stripped_filename[:tnlen] == tracknumber:
        metadata['title'] = stripped_filename[tnlen:].lstrip()
```
Of course, feel free to use better variable names.