rembo10/headphones — Issue #407: AttributeError: 'NoneType' object has no attribute 'replace' in helpers.py
Author: jhermansen
Created: 2011-12-01 08:00:45+00:00
State: open

I have a pretty large Last.fm profile that I've imported into headphones. After waiting for most (but not all) of the metadata to be downloaded for each album, I forced everything to be marked as wanted by manually modifying the headphones.db file with sqlite. Now, when I try to force a backlog search for wanted albums, I get:

```python
Exception in thread Thread-13:
Traceback (most recent call last):
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 552, in __bootstrap_inner
self.run()
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 505, in run
self.__target(*self.__args, **self.__kwargs)
File "/Users/jhermansen/Sandbox/headphones/headphones/searcher.py", line 65, in searchforalbum
foundNZB = searchNZB(albumid, new)
File "/Users/jhermansen/Sandbox/headphones/headphones/searcher.py", line 95, in searchNZB
cleanalbum = helpers.latinToAscii(helpers.replace_all(albums[1], dic))
File "/Users/jhermansen/Sandbox/headphones/headphones/helpers.py", line 114, in replace_all
text = text.replace(i, j)
AttributeError: 'NoneType' object has no attribute 'replace'
```

Here is the SQL statement I used to update all albums to wanted:

```sql
UPDATE albums SET status='Wanted';
```

Here's a general idea of the size of my database currently:

```sql
sqlite> SELECT COUNT(*) FROM artists;
556
sqlite> SELECT COUNT(*) FROM albums;
2708
```

If I'm doing something wrong, please let me know. I tried to find a way to mass edit all albums, but couldn't. I also couldn't find a way to force an update for artists that had incomplete metadata downloads without forcing all of the rest.